Class NotAcceptableStatusException

All Implemented Interfaces:
Serializable, ErrorResponse

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> mediaTypes)
      Constructor for when the requested Content-Type is not supported.
  • Method Details

    • getHeaders

      public HttpHeaders getHeaders()
      Return HttpHeaders with an "Accept" header that documents the supported media types, if available, or an empty instance otherwise.
      Specified by:
      getHeaders in interface ErrorResponse
      Overrides:
      getHeaders in class ResponseStatusException
    • 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.