Show / Hide Table of Contents

    Class ExceptionUtilityExtensions

    This is an extension implementation of the most common methods on the ExceptionUtility class.

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

    Methods

    | Improve this Doc

    Flatten(Exception)

    Flattens any inner exceptions descendant-or-self from the specified exception into an System.Collections.Generic.IEnumerable<T> sequence of exceptions.

    Declaration
    public static IEnumerable<Exception> Flatten(this Exception exception)
    Parameters
    Type Name Description
    System.Exception exception

    The exception to flatten.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<System.Exception>

    An empty System.Collections.Generic.IEnumerable<T> sequence if no inner exceptions was specified; otherwise any inner exceptions rooted to the specified exception as well as it's descendants.

    Remarks

    If any inner exceptions are referenced this method will iterative flatten all of them descendant-or-self from the specified exception.
    Should the exception be of the new AggregateException type introduced with .NET 4.0, the return sequence of this method will be equal to the result of the InnerExceptions property.

    Exceptions
    Type Condition
    System.ArgumentNullException

    exception is null.

    | Improve this Doc

    Flatten(Exception, Type)

    Flattens any inner exceptions descendant-or-self from the specified exception into an System.Collections.Generic.IEnumerable<T> sequence of exceptions.

    Declaration
    public static IEnumerable<Exception> Flatten(this Exception exception, Type exceptionType)
    Parameters
    Type Name Description
    System.Exception exception

    The exception to flatten.

    System.Type exceptionType

    The type of the specified exception.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<System.Exception>

    An empty System.Collections.Generic.IEnumerable<T> sequence if no inner exceptions was referenced; otherwise any inner exceptions descendant-or-self from the specified exception.

    Remarks

    If any inner exceptions are referenced this method will iterative flatten all of them descendant-or-self from the specified exception.
    Should the exception be of the new AggregateException type introduced with .NET 4.0, the return sequence of this method will be equal to the result of the InnerExceptions property.

    Exceptions
    Type Condition
    System.ArgumentNullException

    exception -or exceptionType is null.

    | Improve this Doc

    ParseException<TResult>(Exception)

    Parses the specified exception for a match on TResult.

    Declaration
    public static TResult ParseException<TResult>(this Exception exception)
        where TResult : Exception
    Parameters
    Type Name Description
    System.Exception exception

    The exception to parse for a match on TResult.

    Returns
    Type Description
    TResult

    The matched exception cast as TResult or null if no match could be resolved.

    Type Parameters
    Name Description
    TResult

    The type of the exception to find a match on.

    Exceptions
    Type Condition
    System.ArgumentNullException

    exception is null.

    | Improve this Doc

    Refine(Exception, MethodDescriptor, Object[])

    Refines the specified exception with valuable meta information extracted from the associated method and parameters.

    Declaration
    public static MethodWrappedException Refine(this Exception exception, MethodDescriptor method, params object[] parameters)
    Parameters
    Type Name Description
    System.Exception exception

    The exception that needs to be thrown.

    MethodDescriptor method

    The method signature containing valuable meta information.

    System.Object[] parameters

    The optional parameters to accompany method.

    Returns
    Type Description
    MethodWrappedException

    The specified exception refined with valuable meta information within a MethodWrappedException.

    Exceptions
    Type Condition
    System.ArgumentNullException

    exception is null - or - method is null.

    | Improve this Doc

    Refine(Exception, MethodBase, Object[])

    Refines the specified exception with valuable meta information extracted from the associated method and parameters.

    Declaration
    public static MethodWrappedException Refine(this Exception exception, MethodBase method, params object[] parameters)
    Parameters
    Type Name Description
    System.Exception exception

    The exception that needs to be thrown.

    System.Reflection.MethodBase method

    The method to extract valuable meta information from.

    System.Object[] parameters

    The optional parameters to accompany method.

    Returns
    Type Description
    MethodWrappedException

    The specified exception refined with valuable meta information within a MethodWrappedException.

    Exceptions
    Type Condition
    System.ArgumentNullException

    exception is null - or - method is null.

    | Improve this Doc

    Unwrap(MethodWrappedException)

    Unwraps the specified wrappedException.

    Declaration
    public static Exception Unwrap(this MethodWrappedException wrappedException)
    Parameters
    Type Name Description
    MethodWrappedException wrappedException

    The wrapped exception to unwrap.

    Returns
    Type Description
    System.Exception

    The originating exception from within MethodWrappedException.

    • Improve this Doc
    • View Source
    Back to top Copyright 2008-2018 Weubphoria. All rights reserved.
    Generated by DocFX