Some IEnumerable extensions that catch exceptions into an ExceptionCollection.
Very useful for unit tests and for deferring exceptions.
Inheritance
ExceptionCollectionExtensions
public static class ExceptionCollectionExtensions
Methods
Performs the action for each item, catching all exceptions into an ExceptionCollection.
Declaration
public static ExceptionCollection TryAll<TSource>(this IEnumerable<TSource> sources, Action<TSource> action)
Parameters
Returns
Type Parameters
Performs the action for each item, catching all errors into an ExceptionCollection.
Only catches the type of Exception that you specify.
Declaration
public static ExceptionCollection<TException> TryAll<TSource, TException>(this IEnumerable<TSource> sources, Action<TSource> action)
where TException : Exception
Parameters
Returns
Type Parameters
Name |
Description |
TSource |
|
TException |
|