Class ExceptionDecoratorExtensions
- Namespace
- Cuemon
- Assembly
- Cuemon.Core.dll
Extension methods for the System.Exception class hidden behind the IDecorator<T> interface.
public static class ExceptionDecoratorExtensions
- Inheritance
-
ObjectExceptionDecoratorExtensions
Methods
Flatten(IDecorator<Exception>)
Flattens any inner exceptions from the enclosed System.Exception of the decorator
into an System.Collections.Generic.IEnumerable<T> sequence of exceptions.
public static IEnumerable<Exception> Flatten(this IDecorator<Exception> decorator)
Parameters
decorator
IDecorator<Exception>The IDecorator<T> to extend.
Returns
- IEnumerable<Exception>
An empty System.Collections.Generic.IEnumerable<T> sequence if no inner exception(s) was specified; otherwise any inner exception(s) chained to the enclosed System.Exception of the
decorator
.
Remarks
If any inner exceptions are referenced, this method will iterative flatten them all from the enclosed System.Exception of the decorator
.
Should the enclosed System.Exception of the decorator
be of System.AggregateException, the return sequence of this method will be equal to the result of the InnerExceptions property after a call to System.AggregateException.Flatten.
Exceptions
- System.ArgumentNullException
decorator
cannot be null.