Class ExceptionDecoratorExtensions
Extension methods for the Exception class tailored to adhere the decorator pattern.
Namespace: Cuemon
Assembly: Cuemon.Core.dll
Syntax
public static class ExceptionDecoratorExtensions
Methods
| Improve this Doc View SourceFlatten(IDecorator<Exception>)
Flattens any inner exceptions from the enclosed Exception of the decorator
into an IEnumerable<T> sequence of exceptions.
Declaration
public static IEnumerable<Exception> Flatten(this IDecorator<Exception> decorator)
Parameters
Type | Name | Description |
---|---|---|
IDecorator<Exception> | decorator | The IDecorator<T> to extend. |
Returns
Type | Description |
---|---|
IEnumerable<Exception> | An empty IEnumerable<T> sequence if no inner exception(s) was specified; otherwise any inner exception(s) chained to the enclosed Exception of the |
Remarks
If any inner exceptions are referenced, this method will iterative flatten them all from the enclosed Exception of the decorator
.
Should the enclosed Exception of the decorator
be of AggregateException, the return sequence of this method will be equal to the result of the InnerExceptions property after a call to Flatten().
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
IDecorator<T>
Decorator<T>