Cfrethrow - MACROMEDIA COLDFUSION MX 61-CFML Reference

Cfml reference
Hide thumbs Also See for COLDFUSION MX 61-CFML:
Table of Contents

Advertisement

cfrethrow

Description
Rethrows the currently active exception. Preserves the exception's
cfcatch.tagContext
Category
Exception handling
Syntax
<cfrethrow>
See also
cferror, cfthrow,
Usage
Use this tag within a
cannot handle an error that it catches. For example, if
DATABASE exception, and the code is designed to handle only CFX exceptions, the handler
raises the exceptions again, with details intact, so that a higher-level handler can process the error
information. If you used the
lost.
Example
<h3>cfrethrow Example</h3>
<!--- Rethrow a DATABASE exception. --->
<cftry>
<cftry>
<cfquery name = "GetMessages" dataSource = "cfsnippets">
SELECT
FROM
</cfquery>
<cfcatch type = "DATABASE">
<!---- If database signalled a 50555 error, ignore; otherwise rethrow
exception. ---->
<cfif cfcatch.sqlstate neq 50555>
<cfrethrow>
</cfif>
</cfcatch>
</cftry>
<cfcatch>
<h3>Sorry, this request can't be completed</h3>
<h4>Catch variables</h4>
<cfoutput>
<cfloop collection = #cfcatch# item = "c">
<br>
<cfif IsSimpleValue(cfcatch[c])>#c# = #cfcatch[c]#
</cfif>
</cfloop>
</cfoutput>
</cfcatch>
</cftry>
variable values.
tags,
Extensibility tags
cftry
block. This tag is useful in error handling code, if the error handler
cfcatch
tag, the type and details of the original exception would be
cfthrow
*
Messages
.
cfcatch
type
cfcatch type = "any"
and
gets a
cfrethrow
297

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents