Used inside a cftry tag. Code in the cffinally block is processed after the main cftry code and, if an exception occurs, the cfcatch code. The cffinally block code always executes, whether or not there is an exception.
<cffinally>
finally { }
try {
writeOutput('hello world<br/>');
throw(message='threw on purpose!');
}catch(any e){
writeOutput('Caught an exception<br/>');
}finally{
writeOutput('Ran clean-up code regardless of error');
}
Caught an exception Ran clean-up code regardless of error
<cftry>
hello world<br/>
<cfthrow message="threw on purpose!" />
<cfcatch type="any">
Caught an exception<br/>
</cfcatch>
<cffinally>
Ran clean-up code regardless of error
</cffinally>
</cftry>
Caught an exception Ran clean-up code regardless of error