ExceptionExtensions
Namespace: SnowBank.Runtime · class
Helper methods for working with exceptions
Methods
GetFirstConcreteException
static Exception GetFirstConcreteException(AggregateException self)
Returns the first non-aggregate exception in the tree of inner-exceptions of an AggregateException
self— AggregateException to unfold
Returns: First exception found by walking the tree of InnerExceptions that is not itself an AggregateException
IsFatalError
static bool IsFatalError(Exception self)
Tests if this is considered to be a "fatal" error that cannot be handled by a local catch block
Returns: true if self is of type ThreadAbortException, OutOfMemoryException, StackOverflowException, or an AggregateException that contains either one of these types
IsLikelyBug
static bool IsLikelyBug(Exception self)
Tests if this type of exception is likely to be caused by a bug, and should be handled with more scrutiny (addintional logging, intentional debugger break, ...)
Returns: true if self is of type NullReferenceException, ArgumentNullException, ArgumentOutOfRangeException, IndexOutOfRangeException or any suspicious type.
Errors that are considered "critical" (ex: , , ...) are matched by
Unwrap
static Exception Unwrap(AggregateException self)
Rethrows the first non-aggregate exception in the tree of inner-exceptions of an AggregateException
self— AggregateException to unfold