Share via


ExceptionFormatter.WriteException Method

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Formats the exception and all nested inner exceptions.

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

Syntax

'Declaration
ProtectedOverridableSubWriteException ( _
    exceptionToFormatAs Exception, _
    outerExceptionAs Exception _
)
protectedvirtualvoidWriteException(
    Exception exceptionToFormat,
    Exception outerException
)
protected:
virtualvoidWriteException(
    Exception^ exceptionToFormat, 
    Exception^ outerException
)
protectedfunctionWriteException(
    exceptionToFormat : Exception, 
    outerException : Exception
)

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

Microsoft.Practices.EnterpriseLibrary.ExceptionHandling Namespace

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.