Guardian Programmer's Guide

Table Of Contents
Creating and Managing Processes
Guardian Programmer’s Guide 421922-014
16 - 27
Analyzing Process-Creation Errors
ERROR := PROCESS_LAUNCH_( PARAM_LIST,
ERROR_DETAIL);
IF ERROR <> 0 THEN ...
.
.
CALL READUPDATEX(RCV^NUM,SBUFFER,RCOUNT,BYTES^READ);
IF <> THEN ...
IF BUFFER[0] = -102 THEN !Process create
BEGIN ! completion message
IF BUFFER [13] <> 0 THEN ... !Error
ELSE
BEGIN
NOWAIT^TAG := BUFFER[1] FOR 2;
PROCESS^HANDLE ':='
BUFFER[3] FOR ZSYS^VAL^PHANDLE^WLEN;
PROCESS^DESCRIPTOR^LENGTH := BUFFER[15];
PROCESS^DESCRIPTOR ':=' BUFFER[20] FOR
PROCESS^DESCRIPTOR^LENGTH;
END;
END;
The returned nowait tag enables you to match the message with the corresponding call
to PROCESS_LAUNCH_.
Analyzing Process-Creation Errors
If your process creation fails, you will receive an error indication in the returned error
value. An additional level of detail is returned in the error_detail parameter. For a
waited creation attempt, these variables are returned by the PROCESS_LAUNCH_
call. For a nowait creation attempt, the error variables are returned in system message
-102.
See the Guardian Procedure Errors and Messages Manual for a list of each possible
value of error and an interpretation of the associated error_detail value.
Waited Creation Errors
If you call PROCESS_LAUNCH_ in a waited manner, you can gather any error
information as soon as the call returns. In addition to the error value returned, you
also get an error_detail parameter. The information returned in error_detail
depends on the value in error. For example, if error is 1, then
PROCESS_LAUNCH_ encountered a file-system error; error_detail indicates
which file-system error.
The following example examines the error_detail parameter:
.
.
ERROR := PROCESS_LAUNCH_( PARAM_LIST,
ERROR_DETAIL,
OUTPUT_LIST:$LEN(OUTPUT_LIST),