PreviousNext

Using Global Error Information Variables

When dcecp encounters an error, it prints a descriptive message, such as:

Error: wrong # args: should be "set varName ?newValue?"

In some cases, error messages alone might be insufficient for determining exactly where a problem occurred. So dcecp stores additional error information in a global variable called errorInfo. Your script can access this information and print it to help you pinpoint the error. Generally, it traces the commands that were executing when the error occurred.

The following command example shows the kind of information that can be stored in the errorInfo variable. Reading backwards you can reasonably determine that the error occurred near line 4 of the script body in the parseagrs procedure called from the _dcp_create_user procedure of a user operation.

dcecp> puts $errorInfo
Unknown option "group"
while executing
"
invoked from within
"
("while" body line 4)
invoked from within
"
(procedure "parseargs" line 60)
invoked from within
"
(procedure "_dcp_create_user" line 64)
invoked from within
"
invoked from within
"
invoked from within
"
(procedure "user" line 24)
"
dcecp>

In addition, dcecp may store another kind of error information in another global variable called errorCode. This variable contains a list like the following that can identify other classes of errors.

UNIX, ENQENT, "insufficient arguments for filename"

The DCE control program sets the errorCode variable to NONE if an error produces no useful error information.