Class QueryException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
in.co.akshitbansal.springwebquery.exception.QueryException
- All Implemented Interfaces:
Serializable
Exception thrown when an RSQL query or pagination request violates
configured field or operator restrictions.
This exception is typically thrown in the following scenarios:
- A query attempts to filter on a field not annotated with
RsqlFilterable - A query uses an operator not allowed for a specific field
- A sort request targets a field not annotated with
Sortable - A field referenced in a query does not exist on the entity
- The RSQL query syntax is malformed or cannot be parsed
This is a runtime exception and is intended to be caught and handled at the controller or advice layer to provide meaningful error responses to API clients.
- 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
-