ExceptionExtensionMethods

public static class ExceptionExtensionMethods
Provides some extension methods for various types of exception.

Methods

Contains<T>

#Example
Test whether an aggregate exception contains an exception of the specified type.
public static bool Contains<T>(
aggregate,
Aggregate exception.
out T
exception
Instance of first exception of type T in the aggregate or null.
)
True if an exception of type T is present in the aggregate.

Contains<T>

#Example
Test whether an aggregate exception contains an exception of the specified type.
public static bool Contains<T>(
aggregate
Aggregate exception.
)
True if an exception of type T is present in the aggregate.

ExtractRhinoVersion

#Example
Try and extract the Rhino main version and service release indicated by the exception entry point.
public static bool ExtractRhinoVersion(
exception,
out int
rhinoVersion,
out int
rhinoServiceRelease
)

IsCancellationException

#Example
Tests whether an exception represents a cancellation. If the exception is a TaskCanceledException, OperationCanceledException or an AggregateException containing any of the above exceptions, the exception as a whole is considered to be a cancelling exception rather than a faulting exception.
public static bool IsCancellationException(
this Exception
exception
)