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
Applicationtype in theCFTHROWtag.-
Any(default) Catches unexpected exceptions. This exception type should be coded as the last
CFCATCHwithin aCFTRYblock.-
CustomType Catches developer-specified exceptions as defined with the
CFTHROWtag.-
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
CFLOCKtag such as timeouts, etc.-
MissingInclude Catches exceptions that occur when an included template isn’t found. This exception type covers exceptions thrown by the
CFINCLUDE,CFMODULE, andCFERRORtags.-
Object Catches exceptions associated with ...
-
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access