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> T
handleMappingExceptionsIfNecessary
(Supplier<T> handler) Handles and maps suitableClientException
s thrown from the given handler to suitable subclasses ofCqrsFrameworkException
.
-
Constructor Details
-
ClientRequestErrorMapper
public ClientRequestErrorMapper()
-
-
Method Details
-
handleMappingExceptionsIfNecessary
Handles and maps suitableClientException
s thrown from the given handler to suitable subclasses ofCqrsFrameworkException
.- Type Parameters:
T
- generic response type for the handler- Parameters:
handler
- encapsulates calls toEsdbClient
operations- Returns:
- the response from the handler if successful
- Throws:
ConcurrencyException
- in case ofClientException.HttpException.HttpClientException
with status code409
ClientInterruptedException
- in case ofClientException.InterruptedException
CqrsFrameworkException.TransientException
- in case ofClientException.HttpException.HttpClientException
with status code408
CqrsFrameworkException.NonTransientException
- in case of any otherClientException.HttpException.HttpClientException
CqrsFrameworkException.TransientException
- in case ofClientException.HttpException.HttpServerException
CqrsFrameworkException.NonTransientException
- in case of any otherClientException.HttpException
CqrsFrameworkException.TransientException
- in case ofClientException.TransportException
CqrsFrameworkException.NonTransientException
- in case ofClientException.MarshallingException
CqrsFrameworkException.NonTransientException
- in case ofClientException.InvalidUsageException
ClientException
- if none of the aforementioned (for internal use only)CqrsFrameworkException
-