Package com.opencqrs.framework.client
Class ClientRequestErrorMapper
java.lang.Object
com.opencqrs.framework.client.ClientRequestErrorMapper
Helper class to map errors from
EsdbClient operations to
CqrsFrameworkException.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> ThandleMappingExceptionsIfNecessary(Supplier<T> handler) Handles and maps suitableClientExceptions thrown from the given handler to suitable subclasses ofCqrsFrameworkException.
-
Constructor Details
-
ClientRequestErrorMapper
public ClientRequestErrorMapper()
-
-
Method Details
-
handleMappingExceptionsIfNecessary
Handles and maps suitableClientExceptions thrown from the given handler to suitable subclasses ofCqrsFrameworkException.- Type Parameters:
T- generic response type for the handler- Parameters:
handler- encapsulates calls toEsdbClientoperations- Returns:
- the response from the handler if successful
- Throws:
ConcurrencyException- in case ofClientException.HttpException.HttpClientExceptionwith status code409ClientInterruptedException- in case ofClientException.InterruptedExceptionCqrsFrameworkException.TransientException- in case ofClientException.HttpException.HttpClientExceptionwith status code408CqrsFrameworkException.NonTransientException- in case of any otherClientException.HttpException.HttpClientExceptionCqrsFrameworkException.TransientException- in case ofClientException.HttpException.HttpServerExceptionCqrsFrameworkException.NonTransientException- in case of any otherClientException.HttpExceptionCqrsFrameworkException.TransientException- in case ofClientException.TransportExceptionCqrsFrameworkException.NonTransientException- in case ofClientException.MarshallingExceptionCqrsFrameworkException.NonTransientException- in case ofClientException.InvalidUsageExceptionClientException- if none of the aforementioned (for internal use only)CqrsFrameworkException
-