public interface RemoteFunctionRequestErrorHandler
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.
Modifier and Type | Method and Description |
---|---|
<RequestT extends AbstractRemoteFunctionRequest<RequestT,RequestResultT>,RequestResultT extends AbstractRemoteFunctionRequestResult<RequestT,RequestResultT>> |
handleRequestResult(RequestResultT requestResult)
Allows to inspect the request result after the request execution and react accordingly.
|
@Nonnull <RequestT extends AbstractRemoteFunctionRequest<RequestT,RequestResultT>,RequestResultT extends AbstractRemoteFunctionRequestResult<RequestT,RequestResultT>> io.vavr.control.Option<RemoteFunctionException> handleRequestResult(@Nonnull RequestResultT requestResult)
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.RequestT
- The type of the requestRequestResultT
- the type of the request resultrequestResult
- The request result to inspectOption
containing a RemoteFunctionException
or being empty.Copyright © 2020 SAP SE. All rights reserved.