Show / Hide Table of Contents

Class TextExceptionFormatter

Implements a plain text formater for exception.

Inheritance
object
ExceptionFormatter
TextExceptionFormatter
ExceptionFormatter.AdditionalInfo
ExceptionFormatter.Exception
ExceptionFormatter.WriteReflectionInfo(Exception)
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Sartorius.SAF.ExceptionHandling
Assembly: Sartorius.SAF.dll
Syntax
public class TextExceptionFormatter : ExceptionFormatter

Properties

View Source

Message

Gets a current formatted text.

Declaration
public string Message { get; }
Property Value
Type Description
string

Methods

View Source

Format(Exception)

Formats the Exception into the underlying stream.

Declaration
public override string Format(Exception ex)
Parameters
Type Name Description
Exception ex
Returns
Type Description
string
Overrides
ExceptionFormatter.Format(Exception)
View Source

Indent()

Indents the TextWriter.

Declaration
protected virtual void Indent()
View Source

WriteAdditionalInfo(NameValueCollection)

Writes the additional properties to the TextWriter.

Declaration
protected override void WriteAdditionalInfo(NameValueCollection additionalInformation)
Parameters
Type Name Description
NameValueCollection additionalInformation

Additional information to be included with the exception report

Overrides
ExceptionFormatter.WriteAdditionalInfo(NameValueCollection)
View Source

WriteDateTime(DateTime)

Writes the current date and time to the TextWriter.

Declaration
protected override void WriteDateTime(DateTime utcNow)
Parameters
Type Name Description
DateTime utcNow

The current time.

Overrides
ExceptionFormatter.WriteDateTime(DateTime)
View Source

WriteDescription()

Writes a generic description to the underlying text stream.

Declaration
protected override void WriteDescription()
Overrides
ExceptionFormatter.WriteDescription()
View Source

WriteException(Exception, Exception)

Writes and formats the exception and all nested inner exceptions to the TextWriter.

Declaration
protected override void WriteException(Exception exceptionToFormat, Exception outerException)
Parameters
Type Name Description
Exception exceptionToFormat

The exception to format.

Exception outerException

The outer exception. This value will be null when writing the outer-most exception.

Overrides
ExceptionFormatter.WriteException(Exception, Exception)
View Source

WriteExceptionType(Type)

Writes the value of the AssemblyQualifiedName property for the specified exception type to the TextWriter.

Declaration
protected override void WriteExceptionType(Type exceptionType)
Parameters
Type Name Description
Type exceptionType

The Type of the exception.

Overrides
ExceptionFormatter.WriteExceptionType(Type)
View Source

WriteFieldInfo(FieldInfo, object)

Writes the name and value of the specified field to the TextWriter.

Declaration
protected override void WriteFieldInfo(FieldInfo fieldInfo, object value)
Parameters
Type Name Description
FieldInfo fieldInfo

The reflected FieldInfo object.

object value

The value of the FieldInfo object.

Overrides
ExceptionFormatter.WriteFieldInfo(FieldInfo, object)
View Source

WriteHelpLink(string)

Writes the value of the specified help link taken from the value of the HelpLink property to the TextWriter.

Declaration
protected override void WriteHelpLink(string helpLink)
Parameters
Type Name Description
string helpLink

The exception's help link.

Overrides
ExceptionFormatter.WriteHelpLink(string)
View Source

WriteMessage(string)

Writes the value of the Message property to the underyling TextWriter.

Declaration
protected override void WriteMessage(string message)
Parameters
Type Name Description
string message

The message to write.

Overrides
ExceptionFormatter.WriteMessage(string)
View Source

WritePropertyInfo(PropertyInfo, object)

Writes the name and value of the specified property to the TextWriter.

Declaration
protected override void WritePropertyInfo(PropertyInfo propertyInfo, object value)
Parameters
Type Name Description
PropertyInfo propertyInfo

The reflected PropertyInfo object.

object value

The value of the PropertyInfo object.

Overrides
ExceptionFormatter.WritePropertyInfo(PropertyInfo, object)
View Source

WriteSource(string)

Writes the value of the specified source taken from the value of the Source property to the TextWriter.

Declaration
protected override void WriteSource(string source)
Parameters
Type Name Description
string source

The source of the exception.

Overrides
ExceptionFormatter.WriteSource(string)
View Source

WriteStackTrace(string)

Writes the value of the StackTrace property to the TextWriter.

Declaration
protected override void WriteStackTrace(string stackTrace)
Parameters
Type Name Description
string stackTrace

The stack trace of the exception.

Overrides
ExceptionFormatter.WriteStackTrace(string)
Remarks

If there is no stack trace available, an appropriate message will be displayed.

Extension Methods

CollectionExtensions.AddRange<T, TCollection>(TCollection, IEnumerable<T>)
SerializableObjectCloneExtension.Clone<T>(T)
  • View Source
Back to top Generated by DocFX