Package org.springframework.web
Class HttpMediaTypeNotAcceptableException
java.lang.Object
java.lang.Throwable
java.lang.Exception
jakarta.servlet.ServletException
org.springframework.web.HttpMediaTypeException
org.springframework.web.HttpMediaTypeNotAcceptableException
- All Implemented Interfaces:
Serializable,ErrorResponse
Exception thrown when the request handler cannot generate a response that is
acceptable by the client.
- Since:
- 3.0
- Author:
- Arjen Poutsma
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for when theAcceptheader cannot be parsed.HttpMediaTypeNotAcceptableException(List<MediaType> mediaTypes) Create a new HttpMediaTypeNotSupportedException. -
Method Summary
Modifier and TypeMethodDescriptionReturn headers to use for the response.intReturn the HTTP status value for the response, potentially non-standard and not resolvable viaHttpStatus.Methods inherited from class org.springframework.web.HttpMediaTypeException
getBody, getSupportedMediaTypesMethods inherited from class jakarta.servlet.ServletException
getRootCauseMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.web.ErrorResponse
getStatus
-
Constructor Details
-
HttpMediaTypeNotAcceptableException
Constructor for when theAcceptheader cannot be parsed.- Parameters:
message- the parse error message
-
HttpMediaTypeNotAcceptableException
Create a new HttpMediaTypeNotSupportedException.- Parameters:
mediaTypes- the list of supported media types
-
-
Method Details
-
getRawStatusCode
public int getRawStatusCode()Description copied from interface:ErrorResponseReturn the HTTP status value for the response, potentially non-standard and not resolvable viaHttpStatus. -
getHeaders
Description copied from interface:ErrorResponseReturn headers to use for the response.
-