Throw error and stop objects from an application server to an ABL client

If an error is thrown out of a top level procedure of an application server (for example, by using RETURN ERROR error-object-expression or UNDO, THROW error-object-expression), the error or stop object being thrown is serialized and sent back to the ABL client. The client then deserializes the object and rethrows it in the context of the RUN statement on the client. This functionality is subject to the same serialization/deserialization restrictions as for any other object. The restrictions particularly relevant to error and stop objects are as follows:

  • In the case of a user-defined class, the object’s class and all the classes in its hierarchy must be marked as SERIALIZABLE. For more information on marking a class SERIALIZABLE, see the CLASS statement in the ABL Reference.
  • .NET and ABL-extended .NET error objects cannot be thrown across the application server boundary.
  • SoapFaultError objects can be thrown from an application server to an ABL client. However, the handle-based object that the SoapFault property points to is not recreated during the deserialization of the SoapFaultError object. It is set to the Unknown (?) value.

In the case of the first two items, if the application server code attempts to throw such an object, any message from the object is written to the application server log. In addition, another error is raised to indicate that the throw failed. That error message is also written to the application server log. An error condition is raised on the RUN statement in the client.

Class-based error and stop objects can also be thrown from an OpenEdge application server to a client for an asynchronous request. In that case, error and stop conditions will not be handled by a CATCH block as the block containing the RUN statement may be long over. Instead, the information must be made available in the PROCEDURE-COMPLETE event handler via attributes of the asynchronous request handle. Therefore, an error object or Progress.Lang.StopError stop object is returned to the client and its reference provided as the value of the ERROR-OBJECT attribute of the asynchronous request handle. Any other stop object (a Progress.Lang.Stop or a subclass) is returned to the client and its reference provided as the value of the STOP-OBJECT attribute of the asynchronous request handle. The ERROR-STATUS system handle's ERROR attribute is also set.