Class QueryException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
in.co.akshitbansal.springwebquery.exception.QueryException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
QueryConfigurationException,QueryValidationException
Base exception thrown for all RSQL query or pagination related errors.
This class serves as the parent for more specific exceptions that distinguish between client-side validation errors and developer-side configuration errors:
QueryValidationException: Thrown when an API consumer provides an invalid query or violates validation rules (e.g., malformed RSQL, disallowed operators, non-filterable fields).QueryConfigurationException: Thrown when the library or entity mapping is misconfigured by the developer (e.g., unregistered custom operators).
Using this base exception in a controller advice or catch block allows handling all query-related errors in a unified manner.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionQueryException(String message) Constructs a new query exception with the specified detail message.QueryException(String message, Throwable cause) Constructs a new query exception with the specified detail message and cause. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
QueryException
Constructs a new query exception with the specified detail message.- Parameters:
message- the detail message explaining the reason for the exception
-
QueryException
Constructs a new query exception with the specified detail message and cause.- Parameters:
message- the detail message explaining the reason for the exceptioncause- the underlying cause of the exception
-