Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 294

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Developing CFML Applications
<cftry>
code that may cause an exception
<cfcatch ...>
<cftry>
First level of exception handling code
<cfcatch ...>
Second level of exception handling code
</cfcatch
</cftry>
</cfcatch>
</cftry>
If an exception occurs in the first level of exception-handling code, the inner
it. (An exception in a
cfcatch
• ColdFusion always responds to the latest exception that gets raised. For example, if code in a
an exception that gets handled by a
ColdFusion displays the default error message for the exception in the
the original exception.
• If an exception occurs when the current tag is nested inside other tags, the CFML processor checks the entire stack
of open tags until it finds a suitable
• Use
with
cftry
cfcatch
on diagnostic information.
• The entire
tag, including all its
cftry
start tag on one page and have the
<cftry>
• For cases when a
cfcatch
described in
"Using the cfrethrow
• If an exception can be safely ignored, use a
<cfcatch Type = Database />
• In problematic cases, enclose an exception-prone tag in a specialized combination of
immediately isolate the tag's exceptions.
Exception information in cfcatch blocks
Within the body of a
cfcatch
contents are described as follows:
Standard cfcatch variables
The following table describes the variables that are available in most
block cannot be handled by
block, and the
cfcatch
combination or reaches the end of the stack.
cftry/cfcatch
to handle exceptions based on their point of origin within an application page, or based
tags, must be on a single ColdFusion page. You cannot place the
cfcatch
</cftry>
block is not able to successfully handle an error, consider using the
tag" on page 296.
tag with no body; for example:
cfcatch
tag, the active exception's properties are available in a
Last updated 1/20/2012
cfcatch
blocks at the same level as that block.)
cfcatch
block causes an exception that has no handler,
cfcatch
block, and you are not notified of
cfcatch
end tag on another page.
cfcatch
blocks:
cfcatch
block can catch and handle
block causes
cftry
tag, as
cfrethrow
and
tags to
cftry
cfcatch
object. The object
289

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents