Error Checking
Error Checking
The .NET Gateway provides error checking as follows:
-
When an error occurs while executing Ensemble proxy methods, the error is, in most cases, a .NET exception, coming either from the original .NET method itself, or from the .NET Gateway engine. When this happens, an error is trapped.
-
The .NET 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 .NET class (which in many cases is the actual .NET 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)