Skip to content

Instantly share code, notes, and snippets.

@bennadel
Created May 6, 2014 11:42
Show Gist options
  • Save bennadel/11559527 to your computer and use it in GitHub Desktop.
Save bennadel/11559527 to your computer and use it in GitHub Desktop.
CFFinally Will Execute Even If CFCatch Throws An Error In ColdFusion
<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