<html>
<head>
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>CFRETHROW</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
   <div id="Description">
   <table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
      <tr> 
         <td valign="top" class="name">CFRETHROW</td>
         <td valign="top" nowrap class="compatibility">&nbsp;</td>
      </tr>
      <tr>
         <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
      </tr>


    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Description</span>
<p>
Rethrows the currently active exception. Preserves the exception's cfcatch.type and cfcatch.tagContext variable values. 
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Category</span>
<p>
Exception handling tags, Extensibility tags
</p>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="syntax"><span class="title">Syntax</span><pre>&lt;cfrethrow&gt;
</pre>    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">See also</span>
<p>
cferror, cfthrow, cftry; "Handling runtime exceptions with ColdFusion tags" in Chapter&#160;14, "Handling Errors," in ColdFusion MX Developer's Guide
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Usage</span>
<p>
Use this tag within a cfcatch block. This tag is useful in error handling code, if the error handler cannot handle an error that it catches. For example, if cfcatch type = &quot;any&quot; gets a 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 cfthrow tag, the type and details of the original exception would be lost.
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Example</span><pre>&lt;h3&gt;cfrethrow Example&lt;/h3&gt;
&lt;!--- Rethrow a DATABASE exception. ---&gt;
&lt;cftry&gt;
   &lt;cftry&gt;
      &lt;cfquery name = &quot;GetMessages&quot; dataSource = &quot;cfdocexamples&quot;&gt;
         SELECT  *
         FROM   Messages
      &lt;/cfquery&gt;
   &lt;cfcatch type = &quot;DATABASE&quot;&gt;
      &lt;!--- If database signalled a 50555 error, ignore; otherwise, rethrow
exception. ---&gt;
      &lt;cfif cfcatch.sqlstate neq 50555&gt;
         &lt;cfrethrow&gt;
      &lt;/cfif&gt;
   &lt;/cfcatch&gt;
   &lt;/cftry&gt;
&lt;cfcatch&gt;
   &lt;h3&gt;Sorry, this request can&#39;t be completed&lt;/h3&gt;
   &lt;h4&gt;Catch variables&lt;/h4&gt;
   &lt;cfoutput&gt;
      &lt;cfloop collection = #cfcatch# item = &quot;c&quot;&gt;
         &lt;br&gt;
         &lt;cfif IsSimpleValue(cfcatch[c])&gt;#c# = #cfcatch[c]#
         &lt;/cfif&gt;
      &lt;/cfloop&gt;
   &lt;/cfoutput&gt;
&lt;/cfcatch&gt;
&lt;/cftry&gt;
</pre>
         </td>
      </tr>
   </table>
   </div>

  </body>
</html>
