Used with the cftry and cfcatch tags. Retrieves a Java exception object from a Java object.
Any Java exception object raised by a previous method call on the Java object.
getException(object)
| Parameter | Description |
|---|---|
| object |
A Java object. |
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.
<!--- Create the Java object reference --->
<cfobject action = create type = java class = primativetype name = myObj>
<!--- Calls the object's constructor --->
<cfset void = myObj.init()>
<cftry>
<cfset void = myObj.DoException() >
<Cfcatch type = "Any">
<cfset exception = getException(myObj)>
<!--- user can call any valid method on the exception object--->
<cfset message = exception.toString()>
<cfoutput>
Error<br>
I got exception <br>
<br> The exception message is: #message# <br>
</cfoutput>
</cfcatch>
</cftry>
ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting
Version 6
Comments are no longer accepted for ColdFusion MX. ColdFusion 8 is the current version.
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt193.htm