Adobe COLDFUSION 9 Manual page 284

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Developing CFML Applications
Custom exceptions
You can generate an exception with your own type by specifying a custom exception type name, for example
MyCustomErrorType, in a
cfthrow
handle the exception. Custom type names must be different from any built-in type names, including basic types and
Java exception classes.
Advanced exception types
The Advanced exceptions consist of a set of specific, narrow exception types. These types are supported in ColdFusion
for backward-compatibility.
Java exception classes
Every ColdFusion exception belongs to, and is 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
Java class of the exception.
For example, if you attempt to use an array function such as
generates an exception that belongs to the
coldfusion.runtime.NonArrayException
In general, most applications do not 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 information describes briefly how ColdFusion handles errors. Detailed information is provided in the
remaining topics.
Missing template errors
If a user requests a page that 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 onServer or hidden form field server-side data validation
ColdFusion does the following:
If the Application CFC (Application.cfc) has an
1
2
If the Application.cfc initialization code or the Application.cfm page has a
handler, 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
3
describing the errors, and a default footer.
For more information on using hidden form field validation, see
on Application.cfc, see
"Designing and Optimizing a ColdFusion
tag. You then specify the custom type name in a
ArrayIsEmpty
exception basic type and the
Expression
Java class.
event handler method, ColdFusion calls the method.
onError
"Validating
Last updated 8/5/2010
cfcatch
on an integer variable, ColdFusion
that specifies a Validation error
cferror
Data" on page 743. For more information
Application" on page 235.
279
or
tag to
cferror

Advertisement

Table of Contents
loading

Table of Contents