Specifying Custom Error Messages With Cferror; Specifying A Custom Error Page - MACROMEDIA COLDFUSION MX 61-DEVELOPING COLDFUSION MX Develop Manual

Developing coldfusion mx applications
Table of Contents

Advertisement

Specifying custom error messages with cferror

Custom error pages let you control the error information that users see. You can specify custom
error pages for different types of errors and handle different types of errors in different ways. For
example, you can create specific pages to handle errors that could be recoverable, such as request
time-outs. You can also make your error messages consistent with the look and feel of your
application.
You can specify the following types of custom error message pages:
Type
Description
Validation
Handles server-side form field data validation errors. The validation error page
cannot include CFML tags, but it can display error page variables.
You can use this attribute only on the Application.cfm page. It has no effect when
used on any other page. Therefore, you can specify only one validation error page
per application, and that page applies to all server-side validation errors.
Exception
Handles specific exception errors. You can specify individual error pages for
different types of exceptions.
Request
Handles any exception that is not otherwise-handled. The request error page runs
after the CFML language processor finishes. As a result, the request error page
cannot include CFML tags, but can display error page variables. A request error
page is useful as a backup if errors occur in other error handlers.

Specifying a custom error page

You specify the custom error pages with the
on the Application.cfm page. For Exception and Request errors, you can set the custom error
pages on each application page. However, because custom error pages generally apply to an entire
application, it is more efficient to put these
more information on using the Application.cfm page, see
Optimizing a ColdFusion Application," on page
The
tag has the attributes listed in the following table:
cferror
Attribute
Description
Type
The type of error that will cause ColdFusion to display this page: Exception, Request,
or Validation.
Exception
Use only for the Exception type. The specific exception or exception category that
will cause the page to be displayed. This attribute can specify any of the types
described in
Template
The ColdFusion page to display.
MailTo
(Optional) An e-mail address. The
variable to this value. The error page can use the
that tells the user to send an error notification. ColdFusion does not send any
message itself.
294
Chapter 14: Handling Errors
cferror
cferror
267.
"About ColdFusion exceptions" on page
cferror
tag. For Validation errors, the tag must be
tags in the Application.cfm file also. For
Chapter 13, "Designing and
288.
tag sets the error page
error.mailTo
error.mailTo
value in a message

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION MX 61-DEVELOPING COLDFUSION MX and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Coldfusion mx

Table of Contents