<html>
<head>
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>GETEXCEPTION</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">GETEXCEPTION</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>
Used with the cftry and cfcatch tags. Retrieves a Java exception object from a Java object. 
</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">Returns</span>
<p>
Any Java exception object raised by a previous method call on the Java object.
</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>
System functions
</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>GetException(object)
</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">Parameters</span>
<p>

</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>
ColdFusion stores a Java exception object for each method call on a Java object. Subsequent method calls reset the exception object. To get the current exception object, you must call GetException on the Java object before other methods are invoked on it.
</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;!--- Create the Java object reference ---&gt;
&lt;cfobject action = create type = java class = primativetype name = myObj&gt;
&lt;!--- Calls the object&#39;s constructor ---&gt;
&lt;cfset void = myObj.init()&gt;
&lt;cftry&gt;
&lt;cfset void = myObj.DoException() &gt;
&lt;Cfcatch type = &quot;Any&quot;&gt;
   &lt;cfset exception = GetException(myObj)&gt;
&lt;!--- User can call any valid method on the exception object.---&gt;
   &lt;cfset message = exception.toString()&gt;
   &lt;cfoutput&gt;
      Error&lt;br&gt;
      I got exception &lt;br&gt;
      &lt;br&gt; The exception message is: #message# &lt;br&gt;
   &lt;/cfoutput&gt; 
&lt;/cfcatch&gt;
&lt;/cftry&gt;
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="OBJECT">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">OBJECT</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>


<p>A Java object.</p>

  </td>
  </tr>
  </table>
</div>

  </body>
</html>
