Contents

cffinally

Description

Placed at the end of a cftry block to execute code regardless of the outcome of the code inside the try block. The code is executed if no error is thrown, an error is thrown but not caught, and an error is thrown but caught.

Category

Other

Implemented

Usage Syntax

<cffinally /> 

[] = Optional attribute

Attributes

No Attributes

Example Usage

Example 1:

<cftry>
	<p>
		No error is thrown. Code executes normally...
	</p>
	
	<cfcatch type="any">
		<p>
			An error was throw but caught!
		</p>
	</cfcatch>
	
	<cffinally>
		<p>
			Just want to say that Railo is cool!
		</p>
	</cffinally>
</cftry>

Example 2:

<cftry>
	<cfthrow message="Testing a try block" type="uncatchable" />
	
	<cfcatch type="any">
		<p>
			An error was throw but caught!
		</p>
	</cfcatch>
	
	<cffinally>
		<p>
			Just want to say that Railo is cool!
		</p>
	</cffinally>
</cftry>

Example 3:

<cftry>
	<p>
		No error is thrown. Code executes normally...
	</p>
	
	<cfcatch type="any">
		<p>
			An error was throw but caught!
		</p>
	</cfcatch>
	
	<cffinally>
		<p>
			Just want to say that Railo is cool!
		</p>
	</cffinally>
</cftry>