Class HttpMediaTypeException

java.lang.Object
java.lang.Throwable
java.lang.Exception
jakarta.servlet.ServletException
org.springframework.web.HttpMediaTypeException
All Implemented Interfaces:
Serializable, ErrorResponse
Direct Known Subclasses:
HttpMediaTypeNotAcceptableException, HttpMediaTypeNotSupportedException

public abstract class HttpMediaTypeException extends jakarta.servlet.ServletException implements ErrorResponse
Abstract base for exceptions related to media types. Adds a list of supported MediaTypes.
Since:
3.0
Author:
Arjen Poutsma
See Also:
  • Constructor Details

    • HttpMediaTypeException

      protected HttpMediaTypeException(@Nullable String message, List<MediaType> supportedMediaTypes, @Nullable String messageDetailCode, Object @Nullable [] messageDetailArguments)
      Create a new HttpMediaTypeException with a list of supported media types.
      Parameters:
      supportedMediaTypes - the list of supported media types
      messageDetailCode - the code to use to resolve the problem "detail" through a MessageSource
      messageDetailArguments - the arguments to make available when resolving the problem "detail" through a MessageSource
      Since:
      6.0
  • Method Details