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

public class QueryException extends RuntimeException
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 Details

    • QueryException

      public QueryException(String message)
      Constructs a new query exception with the specified detail message.
      Parameters:
      message - the detail message explaining the reason for the exception
    • QueryException

      public QueryException(String message, Throwable cause)
      Constructs a new query exception with the specified detail message and cause.
      Parameters:
      message - the detail message explaining the reason for the exception
      cause - the underlying cause of the exception