ExceptionExtensionMethods

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

Methods

Contains<T>

#Example
public static bool Contains<T>(this AggregateException aggregate, out T exception)
Test whether an aggregate exception contains an exception of the specified type.
aggregate (AggregateException)Aggregate exception.
exception (out T)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
public static bool Contains<T>(this AggregateException aggregate)
Test whether an aggregate exception contains an exception of the specified type.
aggregate (AggregateException)Aggregate exception.
True if an exception of type T is present in the aggregate.

ExtractRhinoVersion

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

IsCancellationException

#Example
public static bool IsCancellationException(this Exception exception)
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.
exception (Exception)