Macromedia coldfusion 4.5-cfml language reference User Manual

Page of 608
36
CFML Language Reference 
CFERROR
Provides the ability to display customized HTML pages when errors occur. This allows 
you to maintain a consistent look and feel within your application even when errors 
occur.
Syntax
<CFERROR 
TYPE="Request" or "Validation" or "Monitor" or "Exception"
TEMPLATE="template_path"
MAILTO="email_address"
EXCEPTION=”exception_type”>
TYPE
Required. The type of error that this custom error page is designed to handle:
Specify Exception to handle exceptions. 
Specify Validation to handle data input validation errors that occur when 
submitting a form. A validation error handler is only useful if placed inside the 
Application.cfm
 file.
Specify Monitor to set up an exception monitor.
Specify Request to handle errors that occur during the processing of a page. 
Request is the default. 
See the table under 
CFERROR Error Variables
 for information about the variables 
and other constructs available from the templates used to handle each type of 
error.
TEMPLATE
Required. The relative path to the custom error handling page. The following table 
describes the template to use for each type of error.
Types and Their Corresponding Custom Error Pages 
Type
Custom Error Page
Exception
An exception-handling template that is dynamically 
invoked by the CFML language processor when it 
detects an unhandled exception condition.  
Exception-handling templates may be specified as 
part of an application, via the <CFERROR 
TYPE="Exception"> tag, or may be set via the 
ColdFusion Administrator.
$QH[FHSWLRQKDQGOLQJWHPSODWHFDQXVHWKHIXOO
UDQJHRI&)0/WDJVPDNLQJLWVLJQLILFDQWO\PRUH
SRZHUIXOWKDQ&)(55257<3( 
"
5HTXHVW
"
!
This template also has access to the error variables in 
the table under 
CFERROR Error Variables
.