Used only inside a <cftry>, the cfcatch tag catches and process exceptions.

By specifying the type of error with the type attribute, different types of exceptions can be handled differently.

This tag must have a body.

This tag is also supported within <cfscript>

Attribute Description
string, optional

The name for the struct containing the exception information

by default it is cfcatch (in Lucee, the cfcatch variable will also be populated)

string, optional

Type of catch, default:Any

><!--- body ---></cfcatch>


Simple example with cfcatch

  <cfset a = 3/0>
  <cfdump var="#c#" />  
    <cfdump var="#cfcatch#">

See also