User Guide

cferror 121
Usage
Use this tag to provide custom error messages for pages in an application. This lets you maintain
a consistent look and feel within the application, even when errors occur.
You generally embed this tag in your Application CFC or Application.cfm file to specify error-
handling responsibilities for an entire application. You must put it in one of these files if you
specify
type="validation"; ColdFusion ignores it on any other page.
The
cftry and cfcatch tags provide a more interactive way to handle ColdFusion errors within
a ColdFusion page than the
cferror tag, but the cferror tag is a good safeguard against general
errors.
To ensure that error pages display successfully, avoid using the
cfencode utility 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:
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.
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.
Attribute Req/Opt Default Description