C# Class NUnit.Framework.Internal.ExceptionHelper

ExceptionHelper provides static methods for working with exceptions
Show file Open project: nunit/nunit

Public Methods

Method Description
BuildFriendlyMessage ( Exception exception ) : string

Builds up a message, using the Message field of the specified exception as well as any InnerExceptions. Excludes exception names, creating more readable message

BuildMessage ( Exception exception ) : string

Builds up a message, using the Message field of the specified exception as well as any InnerExceptions.

BuildStackTrace ( Exception exception ) : string

Builds up a message, using the Message field of the specified exception as well as any InnerExceptions.

GetStackTrace ( Exception exception ) : string

Gets the stack trace of the exception.

Rethrow ( Exception exception ) : void

Rethrows an exception, preserving its stack trace

Private Methods

Method Description
BuildMessage ( Exception exception, bool isFriendlyMessage ) : string
ExceptionHelper ( ) : System
FlattenExceptionHierarchy ( Exception exception ) : List
WriteException ( StringBuilder sb, Exception inner, bool isFriendlyMessage ) : void

Method Details

BuildFriendlyMessage() public static method

Builds up a message, using the Message field of the specified exception as well as any InnerExceptions. Excludes exception names, creating more readable message
public static BuildFriendlyMessage ( Exception exception ) : string
exception System.Exception The exception.
return string

BuildMessage() public static method

Builds up a message, using the Message field of the specified exception as well as any InnerExceptions.
public static BuildMessage ( Exception exception ) : string
exception System.Exception The exception.
return string

BuildStackTrace() public static method

Builds up a message, using the Message field of the specified exception as well as any InnerExceptions.
public static BuildStackTrace ( Exception exception ) : string
exception System.Exception The exception.
return string

GetStackTrace() public static method

Gets the stack trace of the exception.
public static GetStackTrace ( Exception exception ) : string
exception System.Exception The exception.
return string

Rethrow() public static method

Rethrows an exception, preserving its stack trace
public static Rethrow ( Exception exception ) : void
exception System.Exception The exception to rethrow
return void