How Coldfusion Handles Errors - MACROMEDIA COLDFUSION MX 61-DEVELOPING COLDFUSION MX Develop Manual

Developing coldfusion mx applications
Table of Contents

Advertisement

Advanced exception types
The Advanced exceptions consist of a set of specific, narrow exception types. These types are
supported in ColdFusion MX for backward-compatibility. For a list of advanced exception types,
see
"Advanced Exception types"
Java exception classes
Every ColdFusion exception belongs to, and can be identified by, a specific Java exception class in
addition to its basic, custom, or advanced type. The first line of the stack trace in the standard
error output for an exception identifies the exception's Java class.
For example, if you attempt to use an array function such as
variable, ColdFusion generates an exception that belongs to the
and the
coldfusion.runtime.NonArrayException
In general, most applications do not need to use Java exception classes to identify exceptions.
However, you can use Java class names to catch exceptions in non-CFML Java objects; for
example, the following line catches all Java input/output exceptions:
<cfcatch type="java.io.IOException">

How ColdFusion handles errors

The following sections describes briefly how ColdFusion handles errors. The rest of this chapter
expands on this information.
Missing template errors
If a user requests a page that the ColdFusion cannot find, and the Administrator Server Settings
Missing Template Handler field specifies a Missing Template Handler page, ColdFusion uses that
page to display error information. Otherwise, it displays a standard error message.
Form field validation errors
When a user enters invalid data in an HTML tag that uses server-side (hidden form field) data
validation, and a
ColdFusion displays the specified error page. Otherwise, it displays the error information in a
standard format that consists of a default header, a bulleted list describing the error(s), and a
default footer. For more information on using hidden form field validation, see
"Validating form field data types," on page
Compiler exception errors
If ColdFusion encounters a compiler exception, how it handles the exception depends on whether
the error occurs on a requested page or on an included page:
If the error occurs on a page that is accessed by a
tag page that you access using the cf_ notation, ColdFusion handles it as a runtime exception
in the page that accesses the tag. See the
description of how these errors are handled.
If the error occurs directly on the requested page, ColdFusion handles the error as follows:
If a
cferror
type, ColdFusion displays the specified error page.
290
Chapter 14: Handling Errors
in
Chapter 2, "ColdFusion Tags,"
tag in the Application.cfm page specifies a Validation error handler,
cferror
tag on the Application.cfm page specifies an error handler for the exception
ArrayIsEmpty
Expression
Java class.
579.
or
cfinclude
"Runtime exception errors"
in CFML Reference.
on an integer
exception basic type
Chapter 26,
tag, or on a custom
cfmodule
section, next, for a

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents