You specify the custom error pages with the cferror
tag. For Validation errors, the tag must be on the Application.cfm page. For Exception and Request errors, you can set the custom error pages on each application page. However, because custom error pages generally apply to an entire application, it is more efficient to put these cferror
tags in the Application.cfm file also. For more information on using the Application.cfm page, see Designing and Optimizing a ColdFusion Application.
The cferror
tag has the attributes listed in the following table:
Attribute | Description |
---|---|
Type |
The type of error that will cause ColdFusion to display this page: Exception, Request, or Validation. |
Exception |
Use only for the Exception type. The specific exception or exception category that will cause the page to be displayed. This attribute can specify any of the types described in About ColdFusion exceptions. |
Template |
The ColdFusion page to display. |
MailTo |
(Optional) An e-mail address. The |
The following cferror
tag specifies a custom error page for exceptions that occur in locking code and informs the error page of the of an e-mail address it can use to send a notification each time this type of error occurs:
<cferror type = "exception"
exception = "lock"
template = "../common/lockexcept.cfm"
mailto = "[email protected]">
For detailed information on the cferror
tag, see CFML Reference.