
284
DEVELOPING
COLDFUSION 9 APPLICATIONS
Developing CFML Applications
Las
t
upda
te
d 8/5/2010
The following
cferror
tag specifies a custom error page for exceptions that occur in locking code and informs the
error page of the e-mail address to 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 the
CFML Reference
.
Creating an error application page
The following table lists the rules and considerations that apply to error application pages:
The following table describes the variables available on error pages: Exception error pages can also use all of the
exception variables listed in the section “
Exception information in cfcatch blocks
” on page 289. 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
.
Attribute
Description
Type
The type of error that causes ColdFusion to display this page: Exception, Request, or Validation.
Exception
Use only for the Exception type. The specific exception or exception category that causes the page to display. This
attribute can specify any of the types described in “
About ColdFusion exceptions
” on page
277.
Template
The ColdFusion page to display.
MailTo
(Optional) An e-mail address. The
cferror
tag sets the error page
error.mailTo
variable to this value. The error
page can use the
error.mailTo
value in a message that tells the user to send an error notification. ColdFusion
does not send any message itself.
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 number 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 number 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.