Cftry/Cfcatch - MACROMEDIA COLDFUSION 4.5-CFML LANGUAGE Reference

Cfml language reference
Table of Contents

Advertisement

232

CFTRY/CFCATCH

Used with one or more CFCATCH tags, the CFTRY tag allows developers to catch and
process exceptions in ColdFusion pages. Exceptions include any event that disrupts
the normal flow of instructions in a ColdFusion page such as failed database
operations, missing include files, and developer-specified events.
Syntax
<CFTRY>
... Add code here
<CFCATCH TYPE="exceptiontype">
... Add exception processing code here
</CFCATCH>
... Additional CFCATCH blocks go here
</CFTRY>
TYPE
Optional. Specifies the type of exception to be handled by the CFCATCH block:
APPLICATION (default)
Database
Template
Security
Object
MissingInclude
Expression
Lock
Custom_type
Any (default)
Usage
You must code at least one CFCATCH tag within a CFTRY block. Code CFCATCH tags at
the end of the CFTRY block. ColdFusion tests CFCATCH tags in the order in which they
appear on the page.
If you specify the type to be ANY, do so in the last CFCATCH tag in the block so that all
of the other tests are executed first.
Note
Applications can optionally use the
exceptions are caught with any of the following type specifications:
TYPE="custom_type"
TYPE="APPLICATION"
Specifying the type as ANY causes the ColdFusion Application Server to
catch exceptions from any CFML tag, data source, or external object,
which your application may not be prepared to handle.
CFTHROW
tag to raise custom exceptions. Such
CFML Language Reference

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION 4.5-CFML LANGUAGE and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Coldfusion 4.5

Table of Contents