Class ExceptionExtensions
- Namespace
- LfrlAnvil.Extensions
- Assembly
- LfrlAnvil.Core.dll
Contains Exception extension methods.
public static class ExceptionExtensions
- Inheritance
-
ExceptionExtensions
- Inherited Members
Methods
Consolidate(IEnumerable<Exception>)
Consolidates a collection of exceptions into a single exception.
[Pure]
public static Exception? Consolidate(this IEnumerable<Exception> exceptions)
Parameters
exceptionsIEnumerable<Exception>Collection of exceptions to consolidate.
Returns
- Exception
New AggregateException when
exceptionscontains more than one element or the sole exception whenexceptionscontains exactly one element or null whenexceptionsis empty.
Rethrow(Exception)
Rethrows the provided exception.
public static Exception Rethrow(this Exception exception)
Parameters
exceptionExceptionException to rethrow.
Returns
- Exception
This method does not return.
Remarks
See Throw(Exception) for more information.