Endjin.Assembly.ChangeDetection.Infrastructure.ExceptionHelper.IsFatal C# (CSharp) Method

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
        public static bool IsFatal(Exception ex)
        {
            if (!(ex is NullReferenceException) && !(ex is StackOverflowException) && !(ex is OutOfMemoryException) && !(ex is ThreadAbortException) && !(ex is IndexOutOfRangeException) && !(ex is AccessViolationException))
            {
                return false;
            }
            return true;
        }