Class WebErrorHandler

Class that can be used to parse ASP.NET and exception error information into an object. This class is ideal for capturing information for logging, notification and display of detailed error information.

Also supports complete Application_Error handling with the HandleError method which works off an exception and provides a complete handler for processing error information with hooks for logging and displaying of an error page.

System.Object
  Westwind.Web.WebErrorHandler
public class WebErrorHandler : object

Class Members

MemberDescription

Constructor

Public constructor requires that an exception is passed in. Generally you'll want to do this is in Application_Error and pass in in the InnerException of the error:

DisplayError

Fired when at the end of the error handling process when an error page needs to be displayed

LogError

Fired when all error information has been collected and the information is ready for logging.

HandleError

Semi generic Application_Error handler method that can be used to handle errors without additional code. You should implement the DisplayError event and LogError Event methods to display a message when ErrorHandlingModes is not Default

public void HandleError(ErrorHandlingModes errorHandlingMode)

Parse

Parses the Exception into properties of this object. Called internally by LogError, but can also be called externally to get easier information about the error through the property interface.

public bool Parse()

ToString

public virtual string ToString()

Browser

The client's browser string.

CompactFormat

If true returns only the error message and URL.

ContentSize

The size of the POST buffer if data was posted.

ErrorMessage

The runtime error message thrown by the application.

FullUrl

The completely qualified Url to this request. Example: http://www.west-wind.com/webstore/item.aspx?sku=WWSTOREDOTNET

IPAddress

The client's IP address

LastException

The last exception that the error parsing uses for creating the error properties when calling Parse().

Locale

The Locale string returned by the browser

Login

The username of the user attached if the user is authenticated.

OriginalHttpStatusCode

Gets the HTTP Status Code

PostBuffer

Content of the POST buffer if the page was posted. The size is limited to 2k. Larger buffers are stripped.

QueryString

The complete querystring.

RawUrl

The raw Web relative URL that caused this exception to occur. Example: /WebStore/Item.aspx?sku=WWHELP

Referer

The referring Url that was used to access the current page that caused the error.

RetrieveSourceLines

Determines whether the routines attempt to retrieve Source Code lines.

ServerVariables

List of all server variables

SourceCode

The source code if available for the error that occurred. The code will include the 5 surrounding lines before and after.

SourceFile

Retrieves the source file if available

SourceLineNumber

Line Number if available

SourceMethod

Method where the error occurred

StackTrace

Stack trace listing as available from the runtime compiler

Time

The time the error was logged.

Requirements

Namespace: Westwind.Web
Assembly: westwind.web.dll

© West Wind Technologies, 1996-2016 • Updated: 12/12/15
Comment or report problem with topic