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
taskTaskThe task to continue.
senderobjectThe sender object.
silentPassTypesType[]The exception types to silently pass.
Returns
- Task
A task that represents the continuation.
Default_OnShown(object, Exception)
Default handler invoked when an exception is shown.
public static void Default_OnShown(object sender, Exception e)
Parameters
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
TThe 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
TThe return type of the function.
Events
OnShown
On Catched or handled.
public static event EventHandler<Exception> OnShown