O'Reilly logo

Sams Teach Yourself ColdFusion® in 21 Days by Charles Mohnike

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required