
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_typ
e"
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.
Содержание COLDFUSION 5-DEVELOPING
Страница 1: ...Macromedia Incorporated Developing ColdFusion Applications MacroMedia ColdFusion 5 ...
Страница 58: ...38 Chapter 3 Querying a Database ...
Страница 134: ...114 Chapter 7 Updating Your Database ...
Страница 210: ...190 Chapter 10 Reusing Code ...
Страница 232: ...212 Chapter 11 Preventing and Handling Errors ...
Страница 238: ...218 Chapter 12 Using the Application Framework ...
Страница 262: ...242 Chapter 12 Using the Application Framework ...
Страница 278: ...258 Chapter 13 Extending ColdFusion Pages with CFML Scripting ...
Страница 320: ...300 Chapter 15 Indexing and Searching Data ...
Страница 336: ...316 Chapter 16 Sending and Receiving E mail ...
Страница 374: ...354 Chapter 18 Interacting with Remote Servers ...