Class ExceptionExtensions
public static class ExceptionExtensions
- Inheritance
-
ExceptionExtensions
- Inherited Members
Methods
FromHierarchy<TSource>(TSource, Func<TSource, TSource>)
Traverses a hierarchy of reference types until null is encountered.
public static IEnumerable<TSource> FromHierarchy<TSource>(this TSource source, Func<TSource, TSource> nextItem) where TSource : class
Parameters
sourceTSourcenextItemFunc<TSource, TSource>
Returns
- IEnumerable<TSource>
Type Parameters
TSource
FromHierarchy<TSource>(TSource, Func<TSource, TSource>, Func<TSource, bool>)
Traverses a hierarchy of objects using a selector function until a condition is met.
public static IEnumerable<TSource> FromHierarchy<TSource>(this TSource source, Func<TSource, TSource> nextItem, Func<TSource, bool> canContinue)
Parameters
Returns
- IEnumerable<TSource>
Type Parameters
TSource
GetAllExceptions(Exception)
Gets all exceptions in the hierarchy, including AggregateException inner exceptions.
public static IEnumerable<Exception> GetAllExceptions(this Exception exception)
Parameters
exceptionException
Returns
GetAllMessages(Exception)
Gets all exception messages concatenated with newlines.
public static string GetAllMessages(this Exception exception)
Parameters
exceptionException
Returns
GetFormattedMessages(Exception)
Gets all exception messages formatted as Markdown with hierarchical bullet points.
public static string GetFormattedMessages(this Exception exception)
Parameters
exceptionException
Returns
GetMessages(Exception)
Gets all exception messages as an enumerable sequence.
public static IEnumerable<string> GetMessages(this Exception exception)
Parameters
exceptionException