Name
cftry
Synopsis
<cftry>CFML
<cfcatch type="exception_type
">HTML and CFML
</cfcatch> <cfcatch type="exception_type
">HTML and CFML
</cfcatch> ... </cftry>
Traps
and processes predefined and developer-specified exceptions within
ColdFusion templates. The
cftry
/cfcatch
tags allow you to
handle exceptions in your templates gracefully, without having to
abort processing. Exceptions occurring within
cfcatch
blocks can’t be handled
by the same cftry
block governing the
cfcatch
block. At least one
cfcatch
block must be nested within a
cftry
block. cfcatch
tags are
processed in the order in which they are coded within a template.
Attributes
-
type="
exception_type
"
Specifies the type of exception to trap. Valid entries are:
-
Application
Catches application-level exceptions defined using the
Application
type in thecfthrow
tag.-
Any
(default) Catches unexpected exceptions. In versions of ColdFusion prior to MX, it was recommended that this exception type be coded as the last
cfcatch
within acftry
block. This is no longer the case in ColdFusion MX.-
CustomType
Catches developer-specified exceptions as defined with the
cfthrow
tag.-
Database
Catches exceptions raised when interacting with data sources.
-
Expression
Catches exceptions that occur when an expression’s evaluation results in an error.
-
Lock
Catches exceptions associated with the
cflock
tag, such as timeouts, etc.-
MissingInclude
Catches exceptions that occur when an included template isn’t found. This exception type covers exceptions ...
-
Get Programming ColdFusion MX, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.