Show / Hide Table of Contents

Class ExceptionDecoratorExtensions

Extension methods for the Exception class tailored to adhere the decorator pattern.

Inheritance
Object
ExceptionDecoratorExtensions
Namespace: Cuemon
Assembly: Cuemon.Core.dll
Syntax
public static class ExceptionDecoratorExtensions

Methods

| Improve this Doc View Source

Flatten(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 decorator.

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

decorator cannot be null.

See Also

IDecorator<T>
Decorator<T>
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright 2008-2022 Geekle. All rights reserved. Code with passion and love; deploy with confidence. 👨‍💻️🔥❤️🚀😎
Generated by DocFX