Macromedia coldfusion 4.5-cfml language reference User Manual

Page of 608
Chapter 1:  ColdFusion Tags
233
TYPE="ANY". 
The custom_type type designates the name of a user-defined type specified with a 
CFTHROW
 tag. CFCATCH has a catch handler that can catch a custom type by pattern, 
providing the custom type is defined as a series of strings concatenated together by 
periods, as in 
µ0\$SS%XVLQHVV5XOH([FHSWLRQ,QYDOLG$FFRXQWµ
. CFCATCH searches 
for a custom type match starting with the most specific and ending with the least 
specific. For example, you could define a type as follows:
&)7+52:7<3( µ0\$SS%XVLQHVV5XOH([FHSWLRQ,QYDOLG$FFRXQWµ!
CFCATCH first searches for the entire type string defined in the CFTHROW tag, as 
follows:
<
&)&$7&+7<3( µ0\$SS%XVLQHVV5XOH([FHSWLRQ,QYDOLG$FFRXQWµ! 
Then it searches for the next most specific:
&)&$7&+7<3( µ0\$SS%XVLQHVV5XOH([FHSWLRQµ! 
Finally, it searches for the least specific:
&)&$7&+7<3( µ0\$SSµ! 
The order in which you code CFCATCH tags designed to catch a custom exception type 
within an application does not matter. A CFCATCH tag searches for the custom 
exception types from most specific to least specific.
If you specify the type to be "APPLICATION, " the CFCATCH tag catches only those 
custom exceptions that have been specified as having the APPLICATION type in the 
CFTHROW tag that defines them.
The tags that throw an exception of TYPE="TEMPLATE" are CFINCLUDE, 
CFMODULE, and CFERROR.
An exception raised within a CFCATCH block cannot be handled by the CFTRY block 
that immediately encloses the CFCATCH tag. However, you can rethrow the currently 
active exception by using the 
CFRETHROW
 tag.
You can use the CFCATCH variable to access exception information:
Type — Exception type, as specified in CFCATCH.
Message — The exception's diagnostic message, if one was provided. If no 
diagnostic message is available, this is an empty string. 
Detail — A detailed message from the CFML interpreter. This message, which 
contains HTML formatting, can help determine which tag threw the exception.
TagContext — The tag stack: the name and position of each tag in the tag stack, 
and the full path names of the files that contain the tags in the tag stack. See the 
note that follows this list for more information.
NativeErrorCode — TYPE=Database only. The native error code associated with 
this exception. Database drivers typically provide error codes to assist diagnosis 
of failing database operations. If no error code was provided, the value of 
NativeErrorCode is -1. 
SQLSTATE — TYPE=Database only. The SQLState associated with this 
exception. Database drivers typically provide error codes to assist diagnosis of