
278
DEVELOPING
COLDFUSION 9 APPLICATIONS
Developing CFML Applications
Las
t
upda
te
d 8/5/2010
ColdFusion exception types
ColdFusion exceptions have types that you specify in the
cferror
,
cfcatch
, and
cfthrow
error-handling tags. A
cferror
or
cfcatch
tag handles only exceptions of the specified type. You identify an exception type by using an
identifier from one (or more) of the following type categories:
•
Basic
•
Custom
•
Advanced
•
Java class
Note:
Use only custom error type names and the
Application
basic type name in
cfthrow
tags. All other built-in
exception type names identify specific types of system-identified errors, so do not use them for errors that you identify
yourself.
Basic exception types
All ColdFusion exceptions except for custom exceptions belong to a basic type category. These types consist of a
broadly defined categorization of ColdFusion exceptions. The following table describes the basic exception types:
Note:
The Any type includes all error with the Java object type of java.lang.Exception. It does not include
java.lang.Throwable errors. To catch Throwable errors, specify java.lang.Throwable in the
cfcatch
tag
type
attribute.
Type
Type name
Description
Database failures
Database
Failed database operations, such as failed SQL statements, ODBC
problems, and so on.
Missing include file errors
MissingInclude
Errors where files specified by the cfinclude, cfmessagebox, and cferror
tags are missing. (A
cferror
tag generates a missingInclude error
only when an error of the type specified in the tag occurs.)
The
MissingInclude
error type is a subcategory of Template error. If
you do not specifically handle the MissingInclude error type, but do
handle the Template error type, the Template error handler catches
these errors.
MissingInclude
errors are caught at runtime.
Template errors
Template
General application page errors, including invalid tag and attribute
names. Most
Template
errors are caught at compile time, not
runtime.
Object exceptions
Object
Exceptions in ColdFusion code that works with objects.
Security exceptions
Security
Catchable exceptions in ColdFusion code that works with security.
Expression exceptions
Expression
Failed expression evaluations; for example, if you try to add 1 and "a".
Locking exceptions
Lock
Failed locking operations, such as when a cflock critical section times
out or fails at runtime.
Verity Search engine exception
SearchEngine
Exceptions generated by the Verity search engine when processing
cfindex
, cfcollection, or cfsearch tags.
Application-defined exception
events raised by
cfthrow
Application
Custom exceptions generated by a cfthrow tag that do not specify a
type, or specify the type as
Application
.
All exceptions
Any
Any exceptions. Includes all types in this table and any exceptions that
are not handled in another error handler, including unexpected
internal and external errors.