Class JSR303ViolationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.axonframework.common.AxonException
org.axonframework.common.AxonNonTransientException
org.axonframework.messaging.core.interception.JSR303ViolationException
- All Implemented Interfaces:
Serializable
Exception indicating that a
Message has been refused due to a structural
validation failure. Typically, resending the same message will result in the exact same exception.
Provides a set of JSR303 ConstraintViolations that provide details about the exact failure of the message.
- Since:
- 1.1
- Author:
- Allard Buijze
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionJSR303ViolationException(Set<jakarta.validation.ConstraintViolation<Object>> violations) Initializes an exception with the givenmessageandviolations. -
Method Summary
Modifier and TypeMethodDescriptionprotected static StringConvert the violations to a human readable format, sorted by class and property e.g.:Returns the violations that were detected when this exception was thrown.Methods inherited from class org.axonframework.common.AxonNonTransientException
isCauseOfMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
JSR303ViolationException
Initializes an exception with the givenmessageandviolations.- Parameters:
violations- the violations that were detected
-
-
Method Details
-
getViolations
Returns the violations that were detected when this exception was thrown.- Returns:
- the violations that were detected when this exception was thrown
-
convert
Convert the violations to a human readable format, sorted by class and property e.g.:property ab in class my.some.Klass may not be null property cd in class my.some.OtherClass length must be between 0 and 3 property cd in class my.some.OtherClass must match "ab.*" property notNull in class my.some.TheClass may not be null
- Parameters:
violations- set of violations that were detected when the exception was thrown- Returns:
- a human-readable string describing the violations
-