Tags · Functions · Objects
Lucee Tag Reference
Choose a tag:

Tag <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'

Body

This tag can't have a body.

Example

	<cfthrow
		[detail="string"]
		[errorcode="string"]
		[extendedinfo="string"]
		[message="any"]
		[object="any"]
		[type="string"]>
	
This tag is also supported within cfscript
	<cfscript>
		throw [any expression];
	</cfscript>

Attributes

The attributes for this tag are fixed. Except for the following attributes no other attributes are allowed.
Name Type Required Description
detail string No A detailed description of the event. The CFML server appends the position of the error to
this description; the server uses this parameter if an error is not caught by your code. 
errorcode string No A custom error code that you supply. 
extendedinfo string No extended information to the exception. 
message any No A message that describes the exceptional event. 
object any No a native java exception Object, if this attribute is defined all other will be ignored 
type string No A custom type or the predefined type Application. Do not enter any other predefined types because
they are not generated by CFML applications. If you specify the exception type Application, you
need not specify a type for cfcatch, because the Application type is the default cfcatch type