C# Class Tickster.Utils.ExceptionSignatureBuilder

Generates exception signatures useful for grouping exceptions together. The signatures are also useful when you wan't to give users an identifier or "error-code" to use when they contact customer service. Use the ToString method to produce small friendly signatures (example: 7815696e). Produces upper case codes by default (controlled by the UseUpperCaseSignature property).
Inheritance: IDisposable
Datei anzeigen Open project: tickster/Tickster.Utilities

Private Properties

Property Type Description
AppendErrorCode void
AppendExceptionMessage void
AppendMethodInfo string
AppendPreprocessedMessage void
AppendStackTrace void
AssertNotDisposed void
GetParameterStrings string[]
RemoveTextWithinStopChars string

Public Methods

Method Description
AddException ( Exception exception ) : void

Add one exception to the builder and traverse all its inner exceptions

AddException ( Exception exception, bool traverseInnerException ) : void

Add one exception to the builder optionally traversing all of its inner exceptions

Clear ( ) : void

Removes all signature data from the builder

Dispose ( ) : void
ExceptionSignatureBuilder ( ) : System

Initializes a new instance of the ExceptionSignatureBuilder class.

GetSignatureBytes ( ) : byte[]

Returns the signature hash (128bit md5)

ToSignatureHashDigest ( ) : string

Returns a 32 characters long hex digest of the signature bytes

ToSignatureString ( ) : string

Computes a 8-character long exception signature taken from the beginning of the exception signature hash digest (ToSignatureHashDigest)

ToString ( ) : string

Computes a 8-character long exception signature taken from the beginning of the exception signature hash digest (ToSignatureHashDigest)

Private Methods

Method Description
AppendErrorCode ( int errorCode ) : void
AppendExceptionMessage ( Exception exception ) : void
AppendMethodInfo ( MethodBase mb ) : string
AppendPreprocessedMessage ( StringBuilder sb, string message ) : void
AppendStackTrace ( Exception exception ) : void
AssertNotDisposed ( ) : void
GetParameterStrings ( ParameterInfo parameterInfo ) : string[]
RemoveTextWithinStopChars ( string value ) : string

Method Details

AddException() public method

Add one exception to the builder and traverse all its inner exceptions
public AddException ( Exception exception ) : void
exception System.Exception The exception to add
return void

AddException() public method

Add one exception to the builder optionally traversing all of its inner exceptions
public AddException ( Exception exception, bool traverseInnerException ) : void
exception System.Exception The exception to add
traverseInnerException bool Whether or not to include all inner exceptions in the signature
return void

Clear() public method

Removes all signature data from the builder
public Clear ( ) : void
return void

Dispose() public method

public Dispose ( ) : void
return void

ExceptionSignatureBuilder() public method

Initializes a new instance of the ExceptionSignatureBuilder class.
public ExceptionSignatureBuilder ( ) : System
return System

GetSignatureBytes() public method

Returns the signature hash (128bit md5)
public GetSignatureBytes ( ) : byte[]
return byte[]

ToSignatureHashDigest() public method

Returns a 32 characters long hex digest of the signature bytes
public ToSignatureHashDigest ( ) : string
return string

ToSignatureString() public method

Computes a 8-character long exception signature taken from the beginning of the exception signature hash digest (ToSignatureHashDigest)
public ToSignatureString ( ) : string
return string

ToString() public method

Computes a 8-character long exception signature taken from the beginning of the exception signature hash digest (ToSignatureHashDigest)
public ToString ( ) : string
return string