DBO Errors and the DataBasic Debugger
Object errors are treated as DataBasic exceptions and it is recommended that an exception handler is defined before any methods are called. If no exception handler is defined, any errors generated are treated as fatal and trapped by the DataBasic debugger. For more information, see DataBasic Exception Handler.
Note that the DataBasic compiler knows nothing about language objects so it is easy to write and compile code that is syntactically incorrect. Problems like incorrect or mistyped method names or signatures will not be noticed until run time. Hence it is strongly recommended that when developing code, the program is RUN with the (F option, or run with the FATAL.WARNINGS environment option set, to force unassigned variables to trap into the DataBasic debugger to catch errors as early as possible.
Errors
If a non-DBO variable is used in DataBasic where a DBO variable is expected, the DataBasic debugger is entered with a [B62] "Invalid DBObject referenced" error.
If a DBO Language Server returns an error:
-
If an exception handler is active, an exception is thrown with the number 10061 and the relevant server error number and message. The %Admin(GetErrorNum) special method returns the error number.
For the DNLS only, the exception message will usually include a description of what went wrong and a stack trace of where it occurred.
-
If there is no exception handler active, the DataBasic debugger will be entered with a [B61] "DBObject server error" followed by the server error number and message.
The DataBasic debugger can interrogate and display DBO variables, but is not possible to modify these variables in any way.
Examples
/Con = <Java object> CONNECTOR
/Mgr = <OBJMGR object> CONNECTOR
/Obj = <Java object> java.lang.String
/Obj = <JSON object> JSON
/Methods = <Java object> [Ljava.lang.reflect.Method;