Class ExceptionConverter
java.lang.Object
io.axoniq.framework.axonserver.connector.shared.ExceptionConverter
Utility class used to serializer
Throwables into ErrorMessages.- Since:
- 4.0
- Author:
- Marc Gathier
-
Method Summary
Modifier and TypeMethodDescriptionstatic AxonExceptionconvertToAxonException(String errorCode, io.axoniq.axonserver.grpc.ErrorMessage errorMessage, io.axoniq.axonserver.grpc.SerializedObject payload) Converts the given error information into anAxonException.static io.axoniq.axonserver.grpc.ErrorMessageconvertToErrorMessage(String clientLocation, @Nullable ErrorCode errorCode, Throwable t) Serializes a givenThrowableinto anErrorMessage.
-
Method Details
-
convertToAxonException
public static AxonException convertToAxonException(String errorCode, io.axoniq.axonserver.grpc.ErrorMessage errorMessage, io.axoniq.axonserver.grpc.SerializedObject payload) Converts the given error information into anAxonException.- Parameters:
errorCode- The error code identifying the type of exception to convert to.errorMessage- TheErrorMessagecontaining details of the error.payload- An optionalSerializedObjectrepresenting additional error data, which may be used in the exception conversion.- Returns:
- An instance of
AxonExceptionrepresenting the given error information.
-