206
Applications can optionally use the
exceptions are caught with any of the following type specifications:
The custom_exception_type type designates the name of a user-defined type
specified in the
An exception raised within a
that immediately encloses the
Exception information in cfcatch
Within a
variables. The following variables are available in most cfcatch blocks:
Property variable
cfcatch.type
cfcatch.message
cfcatch.detail
cfcatch.extendedInfo
cfcatch.errorCode
cfcatch.tagContext
Tag context information
On the Debugging Settings page in the ColdFusion Administrator you can select the
Enable CFML stack trace option. When you enable this option,
available an array of structures called
one level of the ColdFusion runtime's active tag context at the time when the
ColdFusion interpreter detected the exception.
type="custom_exception_type"
"
type="application
type="any"
cfthrow
block, the active exception's properties can be accessed as
cfcatch
Chapter 11 Preventing and Handling Errors
tag to raise custom exceptions. Such
cfthrow
tag.
block cannot be handled by the
cfcatch
tag.
cfcatch
Description
The exception's type, returned as a string.
The exception's diagnostic message, if one was provided.
If no diagnostic message is available, this is an empty
string.
A detailed message from the CFML interpreter. This
message, which contains HTML formatting, can help to
determine which tag threw the exception.
A custom error message. This is returned only for
tags where
type="Application"
Any exception that is a part of the CFML exception
hierarchy supplies a value for this variable.
For
type="Application"
value for this code via the
Type="Database"
,
value as
cfcatch.sqlstate
cfcatch.errorCode
Provides the name and position of each tag in the tag
stack and the full pathnames of the files that contain the
tags in the tag stack.
cfcatch
or a custom type.
,
cfthrow
tags can supply a
errorcode
attribute. For
cfcatch.errorcode
. Otherwise, the value of
is the empty string.
cfcatch
.tagContext. Each structure represents
block
cftry
cfcatch
has the same
blocks make
Need help?
Do you have a question about the COLDFUSION 5-DEVELOPING and is the answer not in the manual?
Questions and answers