Catching a custom exception with cfscript

Viewed 2917

How does one catch a custom exception with try-catch in cfscript?

<cffunction name="myFunction">
  <cfset foo = 1>

  <cfif foo EQ 1>
    <cfthrow type="customExcp" message="FAIL!">
  </cfif>
</cfif>

The try-catch is in cfscript. What should go into the catch() statement?

try {
  myFunction();
} catch () {
  writeOutput("Ooops");
}
1 Answers
Related