View comments | RSS feed
Contents > Developing ColdFusion MX Applications > Handling Errors > Specifying custom error messages with cferror > Creating an error application page PreviousNext

Creating an error application page

The following table lists the rules and considerations that apply to error application pages:

Type

Considerations

Validation

  • Cannot use CFML tags.
  • Can use HTML tags.
  • Can use the Error.InvalidFields, Error.validationHeader, and Error.validationFooter variables by enclosing them with pound signs (#).
  • Cannot use any other CFML variables.

Request

  • Cannot use CFML tags.
  • Can use HTML tags.
  • Can use nine CFML error variables, such as Error.Diagnostics, by enclosing them with pound signs.
  • Cannot use other CFML variables.

Exception

  • Can use full CFML syntax, including tags, functions, and variables.
  • Can use nine standard CFML Error variables and cfcatch variables. Use either Error or cferror as the prefix for both types of variables.
  • Can use other application-defined CFML variables.
  • To display any CFML variable, use the cfoutput tag.

The following table describes the variables available on error pages:

Error page type

Error variable

Description

Validation

error.invalidFields

Unordered list of validation errors that occurred. This includes any text that you specify in the value attribute or a hidden tag used to validate form input.

error.validationHeader

Text for the header of the default validation message.

error.validationFooter

Text for the footer of the default validation message.

Exception and

Request

error.browser

Browser that was running when the error occurred.

error.dateTime

Date and time when the error occurred.

error.diagnostics

Detailed error diagnostics.

error.generatedContent

Any content that ColdFusion generated in response to the request prior to the error.

error.HTTPReferer

Page containing the HTML link to the page on which the error occurred. This value is an empty string if the user specified the page directly in the browser.

error.mailTo

E-mail address of the administrator who should be notified. This value is set in the mailTo attribute of the cferror tag.

error.queryString

URL query string of the client's request, if any.

error.remoteAddress

IP address of the remote client.

error.template

Page being executed when the error occurred.

Exception only

error.messge

Error message associated with the exception.

error.rootCause

Java servlet exception reported by the JVM as the cause of the "root cause" of the exception. This variable is a Java object.

error.tagContext

Array of structures containing information for each tag in the tag stack The tag stack consists of each tag that is currently open. For more information, see Exception information in cfcatch blocks

error.type

Exception type. For more information, see About ColdFusion exceptions.

Exception error pages can also use all of the exception variables listed in the section Exception information in cfcatch blocks. To use these variables, replace the cfcatch prefix with cferror or error. For example, to use the exception message in an error page, refer to it as error.message.

In general, production Exception and Request pages should not display detailed error information, such as that supplied by the error.diagnostics variable. Typically, Exception pages e-mail detailed error information to an administrative address or log the information using the cflog tag instead of displaying it to the user. For more information on using the cflog tag, see Logging errors with the cflog tag.


Contents > Developing ColdFusion MX Applications > Handling Errors > Specifying custom error messages with cferror > Creating an error application page PreviousNext

ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6.1

Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.

Comments


JRH@C said on Sep 5, 2004 at 9:53 PM :
Should "error.messge" actually be "error.message?"

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/errors22.htm