Throws a developer-specified exception, which can be caught
with a cfcatch tag that has any of the following type attribute
options:
type = "custom_type"
type = "Application"
type = "Any"
<cfthrow>
throw(message="");
Custom
Custom
Application
Database
Template
Security
Object
MissingInclude
Expression
Lock
SearchEngine
Throw and Finally requires CF 9+ in cfscript
try {
throw(message="Oops", detail="xyz"); //CF9+
} catch (any e) {
writeOutput("Error: " & e.message);
} finally { //CF9+
writeOutput("I run even if no error");
}
Expected Result: Error: OopsI run even if no error
Signup for cfbreak
to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.