Unosquare
    Show / Hide Table of Contents

    Class ExceptionExtensions

    Provides extension methods for .

    Inheritance
    Object
    ExceptionExtensions
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Swan
    Syntax
    public static class ExceptionExtensions

    Methods

    IsCriticalException(Exception)

    Returns a value that tells whether an is of a type that we better not catch and ignore.

    Declaration
    public static bool IsCriticalException(this Exception this)
    Parameters
    Type Name Description
    Exception this

    The exception being thrown.

    Returns
    Type Description
    Boolean

    true if this is a critical exception; otherwise, false.

    IsFatalException(Exception)

    Returns a value that tells whether an is of a type that will likely cause application failure.

    Declaration
    public static bool IsFatalException(this Exception this)
    Parameters
    Type Name Description
    Exception this

    The exception being thrown.

    Returns
    Type Description
    Boolean

    true if this is a fatal exception; otherwise, false.

    RethrowPreservingStackTrace(Exception)

    Rethrows an already-thrown exception, preserving the stack trace of the original throw.

    This method does not return; its return type is an exception type so it can be used with throw semantics, e.g.: throw ex.RethrowPreservingStackTrace();, to let static code analysis tools that it throws instead of returning.

    Declaration
    public static InternalErrorException RethrowPreservingStackTrace(this Exception this)
    Parameters
    Type Name Description
    Exception this

    The exception to rethrow.

    Returns
    Type Description
    InternalErrorException

    This method should never return; if it does, it is an indication of an internal error, so it returns an instance of InternalErrorException.

    Comments

    Back to top Copyright © 2017-2019 Unosquare