DataRequest - Failed Event

Fired when the Webroutine request fails

Member of DataRequest (PRIM_WEB.DataRequest)

Parameters

NameTypeData TypeDescription
Reason*InputEnumerationReason code for the request failure
Handled*BothBooleanAllow the error to be handled in the routine or forwarded to the application

Details

The Failed event is fired when the execution of a SrvRoutine fails.
 
By default the runtime will end and an error message will appear in the browser. However, by monitoring for the event and setting the Handled parameter to True, the default error handling processing can be overridden and an application can be coded to better handle a failure.
 
Failures not managed at this level can still be processed using the RequestFailed event.

Reasons

Enum ValueDescription
ServerErrorAn error occurred when executing the SrvRoutine. Check the joblog and x_err.log for further information
SessionInvalidThere is no valid session available on the server.
LicenseInvalidThe server license has expired

Example

In this example, when the request fails, some UI disabling code is called.
 
The Handled parameter has not been set, so the error processing will continue. The error and can still be handled globally using RequestFailed, allowing the client application to continue.
Mthroutine Name(GetData)
 
   Define_Com Class(#MyServerModule.GetData) Name(#GetData)
 
   #GetData.ExecuteAsync
 
   Evtroutine Handling(#GetData.Completed)
 
      * Update UI with data
 
   Endroutine
 
   Evtroutine Handling(#GetData.Failed)
 
        #Com_owner.DisableUI
 
   Endroutine
 
Endroutine

See also

All Component Classes

Technical Reference

Febuary 18 V14SP2