Share via


ExceptionFormatter.WriteException Method

Formats the exception and all nested inner exceptions.

Namespace: Microsoft.Practices.EnterpriseLibrary.ExceptionHandling
Assembly: Microsoft.Practices.EnterpriseLibrary.ExceptionHandling (in Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll) Version: 6.0.0.0 (6.0.1304.0)

Syntax

protected virtual void WriteException(
    Exception exceptionToFormat,
    Exception outerException
)
'Declaration
Protected Overridable Sub WriteException ( 
    exceptionToFormat As Exception,
    outerException As Exception
)
protected:
virtual void WriteException(
    Exception^ exceptionToFormat, 
    Exception^ outerException
)

Parameters

  • outerException
    Type: System.Exception
    The outer exception. This value will be null when writing the outer-most exception.

Remarks

This method calls itself recursively until it reaches an exception that does not have an inner exception.

This is a template method which calls the following methods in order

  1. WriteExceptionType(Type)
  2. WriteMessage(String)
  3. WriteSource(String)
  4. WriteHelpLink(String)
  5. WriteReflectionInfo(Exception)
  6. WriteStackTrace(String)
  7. If the specified exception has an inner exception then it makes a recursive call. WriteException(Exception, Exception)

See Also

ExceptionFormatter Class

ExceptionFormatter Members

Microsoft.Practices.EnterpriseLibrary.ExceptionHandling Namespace