Reference / Server API functions - version 1.3 only |
This function retrieves the last fault string the user has set in a Web-Function, or an empty string if there is none.
FUNCTION fgl_ws_server_getFault() RETURNING faultMessage VARCHAR
DEFINE div_input RECORD a INTEGER, b INTEGER END RECORD DEFINE div_output RECORD result INTEGER END RECORD FUNCTION TestServices() DEFINE string VARCHAR(100) ... # Test divide by zero operation LET div_input.a=15 LET div_input.b=0 CALL service_operation_div() LET string=fgl_ws_server_getFault() DISPLAY "Operation div error: ", string ... END FUNCTION FUNCTION service_operation_div() ... IF div_input.b = 0 THEN CALL fgl_ws_server_setFault("Divide by zero") RETURN END IF ... END FUNCTION