BBjAPI::getLastException

In BBj 12.0 and higher, this method is deprecated, use getLastBBjException() or getLastJavaException().

Description

This method returns a java.lang.Throwable object that corresponds to the last exception reported from a failed Java call.


Syntax

Return Value

Method

java.lang.Throwable

getLastException()

Parameters

None.

Return Value

Returns the java.lang.Throwable object.

Remarks

If no errors have been returned from failed Java calls in this session, getLastException() returns NULL().

Example

rem 'Get the last Java exception

rem 'Obtain the instance of the BBjAPI object
let myAPI! = BBjAPI()

rem 'Since the string "x" can't be parsed as an integer, the
rem 'following statement will generate !ERROR = 252 with the message
rem '"Couldn't create object java.lang.Integer".
myInteger! = new java.lang.Integer("x",ERR = GetException)

GetException:
    rem 'Get the Exception object corresponding to the last !ERROR = 252
    myException! = myAPI!.getLastException()

    rem 'This will print "java.lang.NumberFormatException: x"
    PRINT myException!

See Also

BBjAPI

Object Variables

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.