Class ExceptionHandlingFacade
Implements base functionality for the ExceptionHandlingFacade
Implements
Namespace: Sartorius.SAF.ExceptionHandling
Assembly: Sartorius.SAF.dll
Syntax
public abstract class ExceptionHandlingFacade : IExceptionHandlingFacade
Constructors
View SourceExceptionHandlingFacade()
Initializes a new instance of the ExceptionHandlingFacade class.
Declaration
protected ExceptionHandlingFacade()
Properties
View SourceExceptionHandlingBehaviors
Gets or sets the behavior for handling unhandled exceptions.
Declaration
public IExceptionHandlingBehaviors ExceptionHandlingBehaviors { get; set; }
Property Value
| Type | Description |
|---|---|
| IExceptionHandlingBehaviors |
ExceptionsRepository
Gets or sets the default implementation of IExceptionsRepository for saving unhandled exceptions.
Declaration
public IExceptionsRepository ExceptionsRepository { get; set; }
Property Value
| Type | Description |
|---|---|
| IExceptionsRepository |
SendExceptionHandler
The send exception System.EventHandler.
Declaration
protected EventHandler<SendExceptionEventArgs> SendExceptionHandler { get; }
Property Value
| Type | Description |
|---|---|
| System.EventHandler<SendExceptionEventArgs> |
Methods
View SourceHandleCompositionException(CompositionException)
Handles the HandleCompositionException
Declaration
protected virtual bool HandleCompositionException(CompositionException ex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.ComponentModel.Composition.CompositionException | ex | The occured HandleCompositionException. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
HandleException(Exception)
Handles the given exception.
Declaration
public void HandleException(Exception ex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Exception | ex | The given exception. |
HandleReflectionTypeLoadException(ReflectionTypeLoadException)
Handles the ReflectionTypeLoadException.
Declaration
protected virtual bool HandleReflectionTypeLoadException(ReflectionTypeLoadException ex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Reflection.ReflectionTypeLoadException | ex | The ReflectionTypeLoadException. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Returns |
Exceptions
| Type | Condition |
|---|---|
| CustomHandledException | Throws exception with details in message if there are loader exceptions details contained in |
LogException(Exception)
Logs the exception.
Declaration
public abstract void LogException(Exception ex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Exception | ex | The exception to log. |
OnUnhandledException(Exception)
Called by HandleException(Exception) when the exception is not handled by registered custom exception handlers. Do not call this method directly but call HandleException(Exception).
Declaration
protected abstract void OnUnhandledException(Exception ex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Exception | ex | The ex. |
RaiseExceptionHandled()
Raises the ExceptionHandled event.
Declaration
protected void RaiseExceptionHandled()
RaiseSendException(Exception)
Raises the SendException event.
Declaration
protected void RaiseSendException(Exception exception)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Exception | exception | The occured System.Exception. |
RegisterCustomExceptionHandler<T>(Func<T, Boolean>)
Registers the custom exception handler.
Declaration
public 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 | The type of the 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 exception events.
Declaration
public abstract void RegisterUnHandledExceptionEventHandler()
ShouldShutDownApplication(Exception)
Gets a value that indicates whether the application should be shut down if given unhandled exception ex occured.
Declaration
protected bool ShouldShutDownApplication(Exception ex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Exception | ex | An unhandled exception. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
UnRegisterCustomExceptionHandler<T>()
Unregisters the custom exception handler.
Declaration
public void UnRegisterCustomExceptionHandler<T>()
where T : Exception
Type Parameters
| Name | Description |
|---|---|
| T | The type of the exception. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException |
UnRegisterUnhandledExceptionEventHandler()
Remove handlers from the exception events.
Declaration
public abstract void UnRegisterUnhandledExceptionEventHandler()
Events
View SourceExceptionHandled
Raised when an exception has been handled.
Declaration
public event Action ExceptionHandled
Event Type
| Type | Description |
|---|---|
| System.Action |
SendException
Occurs directly when the System.Exception is going to be sent.
Declaration
public event EventHandler<SendExceptionEventArgs> SendException
Event Type
| Type | Description |
|---|---|
| System.EventHandler<SendExceptionEventArgs> |