7. ASOLib—OpenROAD Server Library : ASOLib User Classes : uc_osca (OpenROAD Server) : CheckAndHandleError Method (OpenROAD Client)
 
Share this page                  
CheckAndHandleError Method (OpenROAD Client)
This error handler method is invoked immediately after making a call to a GSCP. Its behavior depends on the type of error (or message) raised by the OpenROAD Server application. Error details are contained within the uc_osca instance.
Fatal Error
The error text is written to the trace file and the application is closed down. If necessary, an exit trap can be used to perform further fatal error handling. Also, if global variable GV_V_OSCA_FATALERROR_PROC has been set to a 4GL procedure name, that procedure will be called before an exit is performed. (The procedure must expect no parameters and must have no return code.) Control is not returned to the caller.
User Error
Usually the error text is displayed to the user and GC_I_RESUME is returned. If global variable GV_V_OSCA_USERERROR_PROC has been set to a 4GL procedurename, that procedure will be called instead of displaying the error text. (The procedure expects no parameters and must have an integer returncode; the returned value will be returned from this CheckAndHandleError method.) In a 4+ tiered system the current client program may itself be an OpenROAD Server application in which case method ReturnWithUserError() is automatically invoked to pass the error back to the calling client.
Information Message
No action is taken and GC_I_PROCEED is returned. Public attribute v_msg_txt can be accessed directly.
No Error
No action is taken and GC_I_PROCEED is returned.
Call4GL return codes can also be checked at the same time (see p_i_aso_retval in the following example). A non-zero value is considered fatal and is preceded with the text, "RemoteServer CALL Failed."
Parameters:
(p_i_aso_retval = integer,
 
p_rs = REMOTESERVER)
Note:  Parameter p_i_aso_retval is required; p_rs is optional and defaults to CurRemoteServer.
Note:  Return Data Type: integer
GC_I_RESUME
GC_I_PROCEED
Examples—CheckAndHandleError Method:
1.
i_status = CurRemoteServer.Call4GL ('MyGSCP', b_osca = BYREF(OSCA));
 IF OSCA.CheckAndHandleError (p_i_aso_retval = i_status) = GC_I_RESUME THEN
    RESUME;
 ELSE
    CurFrame.StatusText = OSCA.v_msg_txt;
 ENDIF;
2.
i_status = MyRS.Call4GL ('MyGSCP', b_osca = BYREF(OSCA));
IF OSCA.CheckAndHandleError (p_i_aso_retval = i_status, p_rs = MyRS) = GC_I_RESUME THEN
    RESUME;
 ELSE
    CurFrame.StatusText = OSCA.v_msg_txt;
 ENDIF;