Created
August 7, 2024 05:57
-
-
Save trycf/57f75d99030a1bcdb10c2c9a5740899b to your computer and use it in GitHub Desktop.
TryCF Gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
function foo(a){ | |
if(a==1){ | |
throw(message="Oops", detail="1", type="oneEX"); | |
} | |
if(a==2){ | |
throw(message="Oops", detail="2", type="twoEX"); | |
} | |
if(a==3){ | |
throw(message="Oops", detail="3", type="threeEX"); | |
} | |
if(a==4){ | |
throw(message="Oops", detail="4", type="fourEX"); | |
} | |
} | |
g = "two" | |
</cfscript> | |
<cftry> | |
<cfset h = foo(2)> | |
<cfcatch name = "PIUTE" type = "#g#" > | |
<!--- The message to display. ---> | |
<h3>You've Thrown a Database <b>Error</b></h3> | |
<cfoutput> | |
<!--- The diagnostic message from ColdFusion. ---> | |
<p>#PIUTE.message#</p> | |
<p>Caught an exception, type = #PIUTE.TYPE#</p> | |
<p>The contents of the tag stack are:</p> | |
<cfdump var="#PIUTE.tagcontext#"> | |
</cfoutput> | |
<cfdump var=" | |
#PIUTE.Type#"> <cfdump var = " | |
#PIUTE.Message#"> <cfdump var = " | |
#PIUTE.ErrorCode#"> <cfdump var = " | |
#PIUTE.ExtendedInfo#"> | |
</cfcatch> | |
</cftry> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment