Table of Contents

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

exceptions IEnumerable<Exception>

Collection of exceptions to consolidate.

Returns

Exception

New AggregateException when exceptions contains more than one element or the sole exception when exceptions contains exactly one element or null when exceptions is empty.

Rethrow(Exception)

Rethrows the provided exception.

public static Exception Rethrow(this Exception exception)

Parameters

exception Exception

Exception to rethrow.

Returns

Exception

This method does not return.

Remarks

See Throw(Exception) for more information.