Interface IExceptionHandlingFacade
Defines methods for handling exceptions.
Namespace: Sartorius.SAF.ExceptionHandling
Assembly: Sartorius.SAF.dll
Syntax
public interface IExceptionHandlingFacade
Properties
View SourceExceptionHandlingBehaviors
Gets or sets the behavior for handling unhandled exceptions.
Declaration
IExceptionHandlingBehaviors ExceptionHandlingBehaviors { get; set; }
Property Value
Type | Description |
---|---|
IExceptionHandlingBehaviors |
ExceptionsRepository
Gets or sets the default implementation of IExceptionsRepository for saving unhandled exceptions.
Declaration
IExceptionsRepository ExceptionsRepository { get; set; }
Property Value
Type | Description |
---|---|
IExceptionsRepository |
Methods
View SourceHandleException(Exception)
Handles the given exception.
Declaration
void HandleException(Exception ex)
Parameters
Type | Name | Description |
---|---|---|
System.Exception | ex | The given exception. |
LogException(Exception)
Logs the exception.
Declaration
void LogException(Exception ex)
Parameters
Type | Name | Description |
---|---|---|
System.Exception | ex | The exception to log. |
RegisterCustomExceptionHandler<T>(Func<T, Boolean>)
Registers the custom exception handler.
Declaration
void RegisterCustomExceptionHandler<T>(Func<T, bool> handler)
where T : Exception
Parameters
Type | Name | Description |
---|---|---|
System.Func<T, System.Boolean> | handler | The handler which returns |
Type Parameters
Name | Description |
---|---|
T | A subtype of System.Exception. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Throws System.ArgumentException if there is already a registered custom exception handler with the given type. |
RegisterUnHandledExceptionEventHandler()
Registers handlers to the DispatcherUnhandledException and UnhandledException events.
Declaration
void RegisterUnHandledExceptionEventHandler()
UnRegisterCustomExceptionHandler<T>()
Unregisters the custom exception handler.
Declaration
void UnRegisterCustomExceptionHandler<T>()
where T : Exception
Type Parameters
Name | Description |
---|---|
T | The type of the exception. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Throws System.ArgumentException if there is no registered custom exception handler with the given type. |
UnRegisterUnhandledExceptionEventHandler()
Unregisters handlers from the DispatcherUnhandledException and UnhandledException events.
Declaration
void UnRegisterUnhandledExceptionEventHandler()
Events
View SourceExceptionHandled
Raised when an exception has been handled.
Declaration
event Action ExceptionHandled
Event Type
Type | Description |
---|---|
System.Action |
SendException
Occurs directly when the System.Exception is going to be sent.
Declaration
event EventHandler<SendExceptionEventArgs> SendException
Event Type
Type | Description |
---|---|
System.EventHandler<SendExceptionEventArgs> |