Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 304

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Developing CFML Applications
<!--- If still get a database error, just return to the calling page
without setting the caller variable. There is no cfcatch body.
This might not be appropriate in some cases.
The Calling page ends up handling this case as if a match was not
found --->
<!--- Still in innermost try block. Rethrow any other errors to the next
try block level --->
</cftry>
<!--- Now in second level try block.
Throw all other types of Database exceptions to the next try
block level --->
<cfelse>
<cfrethrow>
</cfif>
</cfcatch>
<!--- Throw all other exceptions to the next try block level --->
<cfcatch type = "Any">
<cfrethrow>
</cfcatch>
</cftry>
<!--- Now in Outermost try block.
Handle all unhandled exceptions, including rethrown exceptions, by
displaying a message and exiting to the calling page.--->
<cfcatch Type = "Any">
<h2>Sorry</h2>
<p>An unexpected error happened in processing your user inquiry.
Please report the following to technical support:</p>
<cfoutput>
Type: #cfcatch.Type#
Message: #cfcatch.Message#
</cfoutput>
<cfexit method = "exittag">
</cfcatch>
</cftry>
</cfif>
Reviewing the code
The following table describes the code:
<cfset caller.getEmpsResult = getuser>
<cfcatch type = "Database" />
<cfcatch type = "Any">
<cfrethrow>
</cfcatch>
Last updated 1/20/2012
299

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents