User Guide
cferror 103
Usage
Use this tag to provide custom error messages for pages in an application. You generally embed
this tag in the Application.cfm file. For more information, see Chapter 14, “Handling Errors,” in
Developing ColdFusion MX Applications.
To ensure that error pages display successfully, avoid using the
cfencode tag to encode pages that
include the
cferror tag.
Page Types
The following table describes the types of errors you can specify and code you can use on the
pages that handle these error type.
Error variables
The exception-handling page specified in the cferror tag template attribute contains one or
more error variables. ColdFusion substitutes the value of the error variable when an error displays.
The following table lists error variables:
Page type Description Use
Exception Dynamically invoked by the CFML language
processor when it detects an unhandled exception
condition.
Uses the full range of CFML tags. Error variables
must be in
cfoutput tags.
Can handle specific exception
types or display general
information for exceptions.
Request Includes the error variables described in the Error
Variables section.
Cannot include CFML tags, but you can display
values of the error variables by enclosing them in
number signs (#), as in #error.MailTo#.
Use as a backup error handler to
other error handling methods,
including exception type.
Validation Handles data input validation errors that occur
when submitting a form that uses hidden form-field
validation.
Cannot include CFML tags, but you can display
values of the error variables by enclosing them in
number signs (#), as in #Error.InvalidFields#.
You must specify the validation error handler in the
Application.cfm file.
Handles hidden form-field style
validation errors only.
Page type Error variable Description
Validation only error.validationHeader Validation message header text.
error.invalidFields Unordered list of validation errors.
error.validationFooter Validation message footer text.