Skip to main content

Error Checking

Error Checking

The Java Gateway provides error checking as follows:

  • When an error occurs while executing Ensemble proxy methods, the error is, in most cases, a Java exception, coming either from the original Java method itself, or from the Java Gateway engine. When this happens, a <ZJGTW> error is trapped.

  • Java Gateway API methods like %Import() or %Connect() return a typical Ensemble %StatusOpens in a new tab variable.

In both cases, Ensemble records the last error value returned from a Java class (which in many cases is the actual Java exception thrown) in the local variable %objlasterror.

You can retrieve the complete text of the error message by calling $system.OBJ.DisplayError(), as follows:

 Do $system.OBJ.DisplayError(%objlasterror)
FeedbackOpens in a new tab