Catches exceptions that are thrown within a cftry tag. Can be used to handle built-in application exceptions or custom exceptions defined by the developer.
Other
<cfcatch [type="String"]/>
[] = Optional attribute
| Name | Type | Required | Default | Description |
| type | String | No | Type of catch, default:Any |
Example 1:
<cftry> <cfthrow message="Testing a try block" /> <cfcatch type="any"> <p> Any error is handled here! </p> </cfcatch> </cftry>
Example 2:
<cftry> <cfthrow message="Testing a try block" type="uncatchable" /> <cfcatch type="uncatchable"> <p> Only 'uncatchable' errors are handled here... </p> </cfcatch> <cfcatch type="any"> <p> Any error is handled here! </p> </cfcatch> </cftry>