User Guide

102 Chapter 2: ColdFusion Tags
cferror
Description
Displays a custom HTML page when an error occurs. This lets you maintain a consistent look
and feel among an applications functional and error pages.
Category
Exception handling tags, Extensibility tags, Application framework tags
Syntax
<cferror
type = "a type"
template = "template_path"
mailTo = "email_address"
exception = "exception_type">
See also
cfrethrow, cfthrow, cftry
History
ColdFusion MX: Deprecated the monitor option of the exception attribute. It might not work,
and might cause an error, in later releases.
Attributes
Attribute Req/Opt Default Description
type Required Type of error that the custom error page handles. The type
also determines how ColdFusion handles the error page. For
more information, see Chapter 14, “Specifying a custom
error page,” in Developing ColdFusion MX Applications.
exception: a exception of the type specified by the
exception attribute.
validation: errors recognized by sever-side type validation.
request: any encountered error.
template Required Relative path to the custom error page. (A ColdFusion page
was formerly called a template.)
mailTo Optional An E-mail address. This attribute is available on the error
page as the variable
error.mailto. ColdFusion does not
automatically send anything to this address.
exception Optional Any Type of exception that the tag handles:
application: application exceptions
database: database exceptions
template: ColdFusion page exceptions
security: security exceptions
object: object exceptions
missingInclude: missing include file exceptions
expression: expression exceptions
lock: lock exceptions
custom_type: developer-defined exceptions, defined in the
cfthrow tag
any: all exception types
For more information on exception types, see cftry
on page 353