Try OpenEdge Now
skip to main content
Error Handling
Using ABL Error Classes : Enabling stack tracing with error objects
 

Enabling stack tracing with error objects

All error objects have the ability to preserve the call stack in the CallStack property. (The property is populated at the time an error object is instantiated.) Examining the call stack is a valuable debugging feature, but it can potentially consume resources and it is not recommended in a production environment. ABL has an attribute on the SESSION handle called ERROR-STACK-TRACE and a startup parameter called -errorstack to enable or disable this feature. The default value is FALSE (disabled).
If ERROR-STACK-TRACE is FALSE, then the CallStack property of a thrown error object will be the Unknown value (?). The standard usage table for this parameter is shown below:
Operating system and syntax
Windows
-errorstack
Use with
Maximum value
Minimum value
Single-user default
Multi-user default
Client Session
An error object thrown from an AppServer to a client contains the stack trace from the AppServer in its CallStack property. If ERROR-STACK-TRACE is TRUE on the client, the CallStack property will also include the client stack trace. The text "Server StackTrace:" appears at the top of the AppServer stack trace to differentiate it from the the client stack trace. In the example below, the lines in boldface represent the AppServer stack trace:
doIt asclient.p at line 46 (asclient.p)
asclient.p at line 26 (asclient.p)
main.p at line 10 (main.p)

Server StackTrace:
myproc svr.p at line 30 (svr.p)
svr.p at line 5 (svr.p)