Class NotAcceptableStatusException

All Implemented Interfaces:
Serializable

public class NotAcceptableStatusException extends ResponseStatusException
Exception for errors that fit response status 406 (not acceptable).
Since:
5.0
Author:
Rossen Stoyanchev
See Also:
  • Constructor Details

    • NotAcceptableStatusException

      public NotAcceptableStatusException(String reason)
      Constructor for when the requested Content-Type is invalid.
    • NotAcceptableStatusException

      public NotAcceptableStatusException(List<MediaType> supportedMediaTypes)
      Constructor for when the requested Content-Type is not supported.
  • Method Details

    • getResponseHeaders

      public HttpHeaders getResponseHeaders()
      Return HttpHeaders with an "Accept" header, or an empty instance.
      Overrides:
      getResponseHeaders in class ResponseStatusException
      Since:
      5.1.13
    • getSupportedMediaTypes

      public List<MediaType> getSupportedMediaTypes()
      Return the list of supported content types in cases when the Accept header is parsed but not supported, or an empty list otherwise.