Class CommandExecutionException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.axonframework.common.AxonException
org.axonframework.messaging.core.HandlerExecutionException
org.axonframework.messaging.commandhandling.CommandExecutionException
- All Implemented Interfaces:
Serializable
Indicates that an exception has occurred while handling a command. Typically, this class is used to wrap checked
exceptions that have been thrown from a Command Handler while processing an incoming command.
By default, a stack trace is not generated for this exception. However, the stack trace creation can be enforced
explicitly via the constructor accepting the
writableStackTrace parameter.- Since:
- 1.3.0
- Author:
- Allard Buijze
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCommandExecutionException(String message, Throwable cause) Initializes the exception with givenmessageandcause.CommandExecutionException(String message, Throwable cause, @Nullable Object details) Initializes the exception with givenmessage,causeand an object providing application-specificdetails.CommandExecutionException(String message, Throwable cause, @Nullable Object details, boolean writableStackTrace) Initializes the exception with givenmessage,cause, an object providing application-specificdetails, andwritableStackTraceCommandExecutionException(String message, Throwable cause, @Nullable Object details, @Nullable Converter converter, boolean writableStackTrace) Initializes the exception with givenmessage,cause, an object providing application-specificdetails, aconverter, andwritableStackTrace. -
Method Summary
Methods inherited from class org.axonframework.messaging.core.HandlerExecutionException
getDetails, getDetails, getDetails, getDetails, getDetails, getDetails, getDetails, resolveDetailsMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
CommandExecutionException
Initializes the exception with givenmessageandcause.- Parameters:
message- The message describing the exception.cause- The cause of the exception.
-
CommandExecutionException
Initializes the exception with givenmessage,causeand an object providing application-specificdetails.- Parameters:
message- the message describing the exceptioncause- the cause of the exceptiondetails- an object providing more error details (might benull)
-
CommandExecutionException
public CommandExecutionException(String message, Throwable cause, @Nullable Object details, boolean writableStackTrace) Initializes the exception with givenmessage,cause, an object providing application-specificdetails, andwritableStackTrace- Parameters:
message- the message describing the exceptioncause- the cause of the exceptiondetails- an object providing more error details (might benull)writableStackTrace- whether the stack trace should be generated (true) or not (false)
-
CommandExecutionException
@Internal public CommandExecutionException(String message, Throwable cause, @Nullable Object details, @Nullable Converter converter, boolean writableStackTrace) Initializes the exception with givenmessage,cause, an object providing application-specificdetails, aconverter, andwritableStackTrace. This constructor is used by messaging infrastructure to attach aConverterwhen reconstructingdetailsfrom raw data received over an infrastructure boundary (for example, a command dispatched through Axon Server). It is not meant to be used directly by application code, which typically already has the details object in its final form and can useCommandExecutionException(String, Throwable, Object)instead.- Parameters:
message- the message describing the exceptioncause- the cause of the exceptiondetails- an object providing more error details, potentially raw data awaiting conversion (maybenull)converter- theConverterto lazily apply whenHandlerExecutionException.getDetails(Class)is called with a typedetailsdoes not already match, ornullif no such conversion is availablewritableStackTrace- whether the stack trace should be generated (true) or not (false)
-