Class QueryException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
in.co.akshitbansal.springwebquery.exception.QueryException
All Implemented Interfaces:
Serializable

public class QueryException extends RuntimeException
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 a default or custom operator not allowed for a specific field
  • A query uses original field name when the behavior is disabled via FieldMapping.allowOriginalFieldName()
  • A sort request targets a field not annotated with Sortable
  • A field referenced in a query does not exist on the entity
  • A custom operator referenced in RsqlFilterable is not registered
  • 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 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