Class QueryExecutionException

All Implemented Interfaces:
Serializable

public class QueryExecutionException extends HandlerExecutionException
Exception indicating that the execution of a Query Handler has resulted in an exception.

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:
3.1.0
Author:
Marc Gathier
See Also:
  • Constructor Details

    • QueryExecutionException

      public QueryExecutionException(String message, @Nullable Throwable cause)
      Initializes the exception with given message and cause
      Parameters:
      message - message explaining the context of the error
      cause - the underlying cause of the invocation failure
    • QueryExecutionException

      public QueryExecutionException(String message, Throwable cause, @Nullable Object details)
      Initializes the exception with given message, cause and details.
      Parameters:
      message - message explaining the context of the error
      cause - the underlying cause of the invocation failure
      details - an object providing more error details (might be null)
    • QueryExecutionException

      public QueryExecutionException(String message, Throwable cause, @Nullable Object details, boolean writableStackTrace)
      Initializes the exception with given message, cause, details and writableStackTrace
      Parameters:
      message - message explaining the context of the error
      cause - the underlying cause of the invocation failure
      details - an object providing more error details (might be null)
      writableStackTrace - whether the stack trace should be generated (true) or not (false)
    • QueryExecutionException

      @Internal public QueryExecutionException(String message, Throwable cause, @Nullable Object details, @Nullable Converter converter, boolean writableStackTrace)
      Initializes the exception with given message, cause, details, a converter, and writableStackTrace.

      This constructor is used by messaging infrastructure to attach a Converter when reconstructing details from raw data received over an infrastructure boundary (for example, a query 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 use QueryExecutionException(String, Throwable, Object) instead.

      Parameters:
      message - message explaining the context of the error
      cause - the underlying cause of the invocation failure
      details - an object providing more error details, potentially raw data awaiting conversion (may be null)
      converter - the Converter to lazily apply when HandlerExecutionException.getDetails(Class) is called with a type details does not already match, or null if no such conversion is available
      writableStackTrace - whether the stack trace should be generated (true) or not (false)