Class UnsupportedMediaTypeException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.core.NestedRuntimeException
org.springframework.web.reactive.function.UnsupportedMediaTypeException
- All Implemented Interfaces:
Serializable
Exception thrown to indicate that a
Content-Type is not supported.- Since:
- 5.0
- Author:
- Arjen Poutsma
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionUnsupportedMediaTypeException(String reason) Constructor for when the specified Content-Type is invalid.UnsupportedMediaTypeException(@Nullable MediaType contentType, List<MediaType> supportedTypes) Constructor for when the Content-Type can be parsed but is not supported.UnsupportedMediaTypeException(@Nullable MediaType contentType, List<MediaType> supportedTypes, @Nullable ResolvableType bodyType) Constructor for when trying to encode from or decode to a specific Java type. -
Method Summary
Modifier and TypeMethodDescriptionReturn the body type in the context of which this exception was generated.Return the request Content-Type header if it was parsed successfully, ornullotherwise.Return the list of supported content types in cases when the Content-Type header is parsed but not supported, or an empty list otherwise.Methods inherited from class NestedRuntimeException
contains, getMostSpecificCause, getRootCauseMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
UnsupportedMediaTypeException
Constructor for when the specified Content-Type is invalid. -
UnsupportedMediaTypeException
-
UnsupportedMediaTypeException
-
-
Method Details
-
getContentType
-
getSupportedMediaTypes
-
getBodyType
Return the body type in the context of which this exception was generated. This is applicable when the exception was raised as a result trying to encode from or decode to a specific Java type.- Returns:
- the body type, or
nullif not available - Since:
- 5.1
-