User Guide
Handling Exceptions in ColdFusion 205
Types of recoverable exceptions supported
ColdFusion Server supports several types of recoverable exceptions. Use the type
attribute in the
cfcatch tag to determine which type of exception to catch. You can
also use these types as the values of the
exception attribute in cferror
type=exception
tags.
You can specify the following basic exception types. For a list of advanced exception
types, see the CFML Reference.
Specifying the type as any causes the ColdFusion Application Server to catch internal
exceptions, memory allocation errors, and access violations, which you might not be
prepared to handle.
Type Tag(s) Notes
Database failures
cfcatch type="Database"
Catch failed database operations, such as
failed SQL statements, ODBC problems,
and so on.
Template errors
cfcatch type="Template"
Catch general application page errors.
The cfinclude, cfmodule, and cferror
tags can generate a template exception.
Missing included file
errors
cfcatch type="missingInclude"
Catch errors where included files are
missing.
Object exceptions
cfcatch type="Object"
Catch exceptions in ColdFusion code that
works with objects.
Security exceptions
cfcatch type="Security"
Raise catchable exceptions in ColdFusion
code that works with security.
Expression exceptions
cfcatch type="Expression"
Catch exceptions when an expression fails
evaluation.
Locking exceptions
cfcatch type="Lock"
Catch failed locking operations, such as
when a
cflock critical section times out or
fails at runtime.
Application-defined
exception events
raised by
cfthrow
cfcatch type="Application"
a cfcatch block that has no
type attribute
Catch only those custom exceptions that
are specified as having the Application type
in the cfthrow tag that defines them.
Custom exceptions
raised by
cfthrow
cfcatch
type="custom_exception_type"
Catch a custom a exception type raised by
cfthrow.
Unspecified
exceptions
cfcatch type="Any"
Catch any exceptions that are not
specifically handled in another error
handler, including unexpected internal
errors.