Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 288

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Developing CFML Applications
Technique
Use
cferror
with
exception-
Use the
specific error handler
but they can provide the user with information about the cause of the error and the steps to take to prevent the
pages
problem.
For more information, see
cferror
with a Request
Use the
error page
for unrecoverable exceptions. Place the tag in the Application.cfc initialization code or on the Application.cfm
page to make it apply to all pages in an application.
A Request error page cannot use CFML tags, but it can display error variables. As a result, you can use it to display
common error information, but you cannot provide error-specific instructions. Typically, Request pages display
error variable values and application-specific information, including support contact information.
For example code, see Example of a request error page section.
Site-wide error handler
Specify a site-wide error handler in the Administrator to provide consistent appearance and contents for all
page
otherwise-unhandled exceptions in all applications on your server.
Like the Request page, the site-wide error handler cannot perform error recovery. However, it can include CFML
tags in addition to the error variables.
Because a site-wide error handler prevents ColdFusion from displaying the default error message, it allows you to
limit the information reported to users. It also lets you provide all users with default contact information or other
instructions.
Specifying custom error messages with the cferror tag
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 in the Application.cfc initialization code or 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
initialization code or 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 place these
on using these pages, see
"Designing and Optimizing a ColdFusion
The
tag has the attributes listed in the following table:
cferror
cferror
tag to specify error pages for specific exception types. These pages cannot recover from errors,
"Specifying custom error messages with the cferror
cferror
tag to specify a Request error handler that provides a customized, application-specific message
tag. For Validation errors, the tag must be in the Application.cfc
cferror
tags in the Application.cfc or Application.cfm file also. For more information
cferror
Last updated 1/20/2012
tag" on page 283.
Application" on page 235
283

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents