Show / Hide Table of Contents

Class TextExceptionFormatter

Implements a plain text formater for exception.

Inheritance
System.Object
ExceptionFormatter
TextExceptionFormatter
ExceptionFormatter.AdditionalInfo
ExceptionFormatter.Exception
ExceptionFormatter.WriteReflectionInfo(Exception)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.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
System.String

Methods

View Source

Format(Exception)

Formats the System.Exception into the underlying stream.

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

Indent()

Indents the System.IO.TextWriter.

Declaration
protected virtual void Indent()
View Source

WriteAdditionalInfo(NameValueCollection)

Writes the additional properties to the System.IO.TextWriter.

Declaration
protected override void WriteAdditionalInfo(NameValueCollection additionalInformation)
Parameters
Type Name Description
System.Collections.Specialized.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 System.IO.TextWriter.

Declaration
protected override void WriteDateTime(DateTime utcNow)
Parameters
Type Name Description
System.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 System.IO.TextWriter.

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

The exception to format.

System.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 System.Type.AssemblyQualifiedName property for the specified exception type to the System.IO.TextWriter.

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

The System.Type of the exception.

Overrides
ExceptionFormatter.WriteExceptionType(Type)
View Source

WriteFieldInfo(FieldInfo, Object)

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

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

The reflected System.Reflection.FieldInfo object.

System.Object value

The value of the System.Reflection.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 System.Exception.HelpLink property to the System.IO.TextWriter.

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

The exception's help link.

Overrides
ExceptionFormatter.WriteHelpLink(String)
View Source

WriteMessage(String)

Writes the value of the System.Exception.Message property to the underyling System.IO.TextWriter.

Declaration
protected override void WriteMessage(string message)
Parameters
Type Name Description
System.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 System.IO.TextWriter.

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

The reflected System.Reflection.PropertyInfo object.

System.Object value

The value of the System.Reflection.PropertyInfo object.

Overrides
ExceptionFormatter.WritePropertyInfo(PropertyInfo, Object)
View Source

WriteSource(String)

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

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

The source of the exception.

Overrides
ExceptionFormatter.WriteSource(String)
View Source

WriteStackTrace(String)

Writes the value of the System.Exception.StackTrace property to the System.IO.TextWriter.

Declaration
protected override void WriteStackTrace(string stackTrace)
Parameters
Type Name Description
System.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