C# Class Endjin.Assembly.ChangeDetection.Infrastructure.ExceptionHelper

Use this class in your catch(Exception ex) handler to determine if you can safely swallow and trace this exception or if it is so severe that it should be propagated to the highest layer. It is mandatory to use this function inside your finalizer to guard the finalizer thread against exceptions.
Show file Open project: endjin/Endjin.Assembly.ChangeDetection

Public Methods

Method Description
IsFatal ( Exception ex ) : bool

It is mandatory to use this function inside your finalizer to guard the finalizer thread against exceptions. Determines whether the specified exception is fatal and should be propagated to the next layer regardless of your current exception policy. An exception is considered fatal is it is one of the following types: NullReferenceException, StackOverflowException, OutOfMemoryException, ThreadAbortException, ExecutionEngineException, IndexOutOfRangeException or AccessViolationException

IsSecurityOrFatal ( Exception ex ) : bool

Determines whether the exception is a security or fatal exception. Use this functions in security relevant code inside any catch(Exception ex) handler to prevent swallowing relevant exceptions.

WhenException ( System.Action executeWhenExceptionHasOccured ) : void

Normally used in a finally block to execute code when an exception has occured.

Method Details

IsFatal() public static method

It is mandatory to use this function inside your finalizer to guard the finalizer thread against exceptions. Determines whether the specified exception is fatal and should be propagated to the next layer regardless of your current exception policy. An exception is considered fatal is it is one of the following types: NullReferenceException, StackOverflowException, OutOfMemoryException, ThreadAbortException, ExecutionEngineException, IndexOutOfRangeException or AccessViolationException
public static IsFatal ( Exception ex ) : bool
ex System.Exception The exception to check.
return bool

IsSecurityOrFatal() public static method

Determines whether the exception is a security or fatal exception. Use this functions in security relevant code inside any catch(Exception ex) handler to prevent swallowing relevant exceptions.
public static IsSecurityOrFatal ( Exception ex ) : bool
ex System.Exception The exception to test.
return bool

WhenException() public static method

Normally used in a finally block to execute code when an exception has occured.
public static WhenException ( System.Action executeWhenExceptionHasOccured ) : void
executeWhenExceptionHasOccured System.Action The method to execute when exception has occured.
return void