August 2001
Intermediate to advanced
976 pages
38h 8m
English
GetException —
GetException(object_name)Used in conjunction with the
CFTRY/CFCATCH tags,
GetException() returns a Java exception object
thrown by the specified object.
The following example shows how to use
GetException() with an imaginary Java object
called MyObject:
<CFOBJECT TYPE="Java" ACTION="Create" CLASS="MyClass" NAME="MyObject">
<CFTRY>
<CFSET Test = MyObject.CauseError() >
<CFCATCH TYPE="Any">
<CFSET MyException = GetException(MyObject)>
<!--- call the GetErrCode and GerErrMsg methods within the exception
object --->
<CFSET ErrorCode = MyException.GetErrCode()
<CFSET ErrorMessage = MyException.GetErrMsg()>
<CFOUTPUT>
Error Code: #ErrorCode#<BR>
Error Message: #ErrorMessage#
</CFOUTPUT>
</CFCATCH>
</CFTRY>Read now
Unlock full access