Generating Custom Error Messages (Cferror); Creating An Error Application Page - MACROMEDIA COLDFUSION 4.5-DEVELOPING WEB Develop Manual

Developing web applications with coldfusion
Table of Contents

Advertisement

Chapter 8: Debugging and Error Handling

Generating Custom Error Messages (CFERROR)

ColdFusion displays error pages that can help you to debug your application. There are
four types of errors in ColdFusion:
REQUEST — Request errors occur when a application page is requested and
there is an error in the page's code.
VALIDATION — Validation errors occur when a user violates the form field
validation rules during a form submittal.
EXCEPTION — Exception errors handle exceptions.
MONITOR — Sets up an exception monitor.
By default, ColdFusion returns a standard page for these errors. But you may want to
customize the error pages that are returned, to make them consistent with the look
and feel of your application. Custom error pages also allow you to control the error
information that users see, as well as offering work-arounds or ways for users to report
the errors.
You set the custom error application pages with the CFERROR tag. You can set the
custom error application pages page-by-page, but because custom error pages
generally apply to an entire application, it is more efficient to include the CFERROR tag
in the
Application.cfm
the CFERROR tag in your application's
the Web Application Framework" on page 184
For information on the syntax of the CFERROR tag, see the CFML Language Reference.

Creating an error application page

The error application page is a file that includes HTML and the parameters associated
with the error. The error application page cannot use any CFML tags.
The parameters associated with an error depend on the type of error. All the error
parameters use the Error prefix (for example,
See the CFML Language Reference for more information on the error variables and on
using the CFERROR tag.
The following examples show the two types of custom error pages.
Example of a request error
The following example shows a custom error page for a request error:
<HTML>
<HEAD>
<TITLE>Products - Error</TITLE>
</HEAD>
<BODY>
<CFOUTPUT>
<H2>Sorry</H2>
file. After you create a custom error page, you must include
Application.cfm
for more information.
Error.Diagnostics
page. See
"Understanding
).
93

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Subscribe to Our Youtube Channel

This manual is also suitable for:

Coldfusion 4.5

Table of Contents