如何在cfscript中使用try-catch捕获自定义异常?
<cffunction name="myFunction">
<cfset foo = 1>
<cfif foo EQ 1>
<cfthrow type="customExcp" message="FAIL!">
</cfif>
</cfif>
< p > try-catch
是在 cfscript 中使用的。在 catch()
语句中应该放什么?< /p >
try {
myFunction();
} catch () {
writeOutput("Ooops");
}