Class ExceptionUtil
Provides utility methods for handling exceptions.
public static class ExceptionUtil
- Inheritance
-
ExceptionUtil
- Inherited Members
Methods
CatchWithSilentPass(Task, object, params Type[])
Continues the task and silently passes specified exception types.
public static Task CatchWithSilentPass(this Task task, object sender, params Type[] silentPassTypes)
Parameters
task
TaskThe task to continue.
sender
objectThe sender object.
silentPassTypes
Type[]The exception types to silently pass.
Returns
- Task
A task that represents the continuation.
ShowException(Exception, object)
Shows the exception by invoking the OnShown event.
public static void ShowException(this Exception exception, object sender)
Parameters
ShowIfCatched(Task, object)
Continues the task and shows any exception that occurs.
public static Task ShowIfCatched(this Task task, object sender)
Parameters
Returns
- Task
A task that represents the continuation.
ShowIfCatched<T>(Action, object)
Executes the specified action and shows any exception that occurs.
public static void ShowIfCatched<T>(this Action action, object sender = null)
Parameters
Type Parameters
T
The type of the action.
ShowIfCatched<T>(Func<T>, object)
Executes the specified function and shows any exception that occurs.
public static T ShowIfCatched<T>(this Func<T> func, object sender = null)
Parameters
Returns
- T
The result of the function, or default(T) if an exception occurs.
Type Parameters
T
The return type of the function.
Events
OnShown
On Catched or handled.
public static event EventHandler<Exception> OnShown