Interface RemoteFunctionRequestErrorHandler


@Deprecated public interface RemoteFunctionRequestErrorHandler
Deprecated.
This module will be discontinued, along with its classes and methods.
Gets invoked after the execution of an AbstractRemoteFunctionRequest and allows to inspect and react on the AbstractRemoteFunctionRequestResult.

Example:

You may implement and register your own RemoteFunctionRequestErrorHandler for the invocation of BAPIs. You want to introduce special treament for a certain error message of the invoked BAPI. In your own RemoteFunctionRequestErrorHandler you gain access to the request result and can react accordingly.

Note: The request execution logic of AbstractRemoteFunctionRequest using a CommitStrategy that includes a commit in the remote system (CommitStrategy.COMMIT_SYNC, CommitStrategy.COMMIT_ASYNC) invokes a rollback in the remote system if the used RemoteFunctionRequestErrorHandler throws a RemoteFunctionException. Otherwise, no rollback is invoked the remote system.

  • Method Details

    • handleRequestResult

      @Nonnull <RequestT extends AbstractRemoteFunctionRequest<RequestT, RequestResultT>, RequestResultT extends AbstractRemoteFunctionRequestResult<RequestT, RequestResultT>> io.vavr.control.Option<RemoteFunctionException> handleRequestResult(@Nonnull RequestResultT requestResult)
      Deprecated.
      Allows to inspect the request result after the request execution and react accordingly. In order to indicate an error situation, you may return a RemoteFunctionException or one subclass encapsulated in an Option. Otherwise, return an empty Option. In case of an error situation, the request exceution logic triggers a rollback in the remote system if a CommitStrategy including commit behaviour is used.
      Type Parameters:
      RequestT - The type of the request
      RequestResultT - the type of the request result
      Parameters:
      requestResult - The request result to inspect
      Returns:
      Option containing a RemoteFunctionException or being empty.