OSF DCE Administration Guide--Core Components
OSF DCE Administration Guide—Core Components
The following example shows the kind of information that can be stored in errorInfo.
Reading backwards, you can 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, ENOENT, "insufficient arguments for filename"
The DCE control program sets the errorCode variable to NONE if an error produces no
useful error information.
2.14.2 Usingcatch to Trap Errors and Exceptions
Occasionally, you might want to trap some kinds of errors rather than let them terminate
an active command. The catch command lets you trap and ignore errors so your script
can continue processing. Let’s say your script wants to rename a command if it exists.
However, it’s possible that the command name might not exist when you execute the
rename command.
dcecp> rename move move.old
Error: can’t rename "move": command doesn’t exist
dcecp>
2− 30 Tandem Computers Incorporated 124243