Created
May 6, 2014 11:42
-
-
Save bennadel/11559527 to your computer and use it in GitHub Desktop.
CFFinally Will Execute Even If CFCatch Throws An Error In ColdFusion
This file contains hidden or 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> | |
logfile = fileOpen( expandPath( "./log.txt" ), "append" ); | |
try { | |
fileWriteLine( logfile, "In Try" ); | |
throw( type = "TryError" ); | |
} catch ( any error ) { | |
fileWriteLine( logfile, "In Catch" ); | |
rethrow; | |
} finally { | |
fileWriteLine( logfile, "In Finally" ); | |
fileClose( logfile ); | |
} | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment