<cfthrow>
The cfthrow tag raises a developer-specified exception that can be caught with <cfcatch> tag having any of the following type specifications
- cfcatch type = 'custom_type'
- cfcatch type = 'Application'
- cfcatch type = 'Any'
This tag cannot have a body.
This tag is also supported within <cfscript>
<cfthrow
type=string
message=any
detail=string
errorcode=string
extendedinfo=string
object=any
cause=any
>
Examples
Tag example
<cftry>
<cfthrow message="test exception">
<cfcatch name="test" type="any">
<cfdump var="#cfcatch#">
</cfcatch>
</cftry>
Script example
try {
throw message="test exception"; //CF9+
} catch (any e) {
echo("#cfcatch#");
}
See also
- Debugging
- Exception Output
- Throw()
- <cfcatch>
- <cffinally>
- <cfrethrow>
- <cfretry>
- <cftry>
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)