Package org.springframework.web.server
Class NotAcceptableStatusException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.core.NestedRuntimeException
org.springframework.web.ErrorResponseException
org.springframework.web.server.ResponseStatusException
org.springframework.web.server.NotAcceptableStatusException
- All Implemented Interfaces:
Serializable
,ErrorResponse
Exception for errors that fit response status 406 (not acceptable).
- Since:
- 5.0
- Author:
- Rossen Stoyanchev
- See Also:
-
Constructor Summary
ConstructorDescriptionNotAcceptableStatusException
(String reason) Constructor for when the requested Content-Type is invalid.NotAcceptableStatusException
(List<MediaType> mediaTypes) Constructor for when the requested Content-Type is not supported. -
Method Summary
Modifier and TypeMethodDescriptionReturn HttpHeaders with an "Accept" header that documents the supported media types, if available, or an empty instance otherwise.Deprecated.Return the list of supported content types in cases when the Accept header is parsed but not supported, or an empty list otherwise.Methods inherited from class org.springframework.web.server.ResponseStatusException
getMessage, getReason
Methods inherited from class org.springframework.web.ErrorResponseException
getBody, getStatusCode, setDetail, setInstance, setTitle, setType
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
NotAcceptableStatusException
Constructor for when the requested Content-Type is invalid. -
NotAcceptableStatusException
Constructor for when the requested Content-Type is not supported.
-
-
Method Details
-
getHeaders
Return HttpHeaders with an "Accept" header that documents the supported media types, if available, or an empty instance otherwise.- Specified by:
getHeaders
in interfaceErrorResponse
- Overrides:
getHeaders
in classResponseStatusException
-
getResponseHeaders
Deprecated.as of 6.0 in favor ofgetHeaders()
Delegates togetHeaders()
.- Overrides:
getResponseHeaders
in classResponseStatusException
- Since:
- 5.1.13
-
getSupportedMediaTypes
Return the list of supported content types in cases when the Accept header is parsed but not supported, or an empty list otherwise.
-
getHeaders()