Table of Contents

IsFatalException Method

Definition

Namespace
Cuemon
Assemblies
Cuemon.Kernel.dll
Source
src/Cuemon.Kernel/Patterns.cs

IsFatalException(Exception)

Determines whether the specified exception is considered fatal and should not be swallowed.

public static bool IsFatalException(Exception exception)

Parameters

exception Exception

The exception to evaluate.

Returns

bool

true if exception is a fatal runtime exception such as OutOfMemoryException, StackOverflowException, SEHException, AccessViolationException, ThreadAbortException or ThreadInterruptedException; otherwise, false.

Remarks

Designed for use as an exception filter: catch (Exception ex) when (!Patterns.IsFatalException(ex)) to prevent accidentally swallowing critical runtime exceptions.