Package org.springframework.core.codec
Class DecodingException
- java.lang.Object
- java.lang.Throwable
- java.lang.Exception
- java.lang.RuntimeException
- org.springframework.core.NestedRuntimeException
- org.springframework.core.codec.CodecException
- org.springframework.core.codec.DecodingException
- All Implemented Interfaces:
Serializable
public class DecodingException extends CodecException
Indicates an issue with decoding the input stream with a focus on content related issues such as a parse failure. As opposed to more general I/O errors, illegal state, or aCodecExceptionsuch as a configuration issue that aDecodermay choose to raise.For example in server web application, a
DecodingExceptionwould translate to a response with a 400 (bad input) status whileCodecExceptionwould translate to 500 (server error) status.- Since:
- 5.0
- Author:
- Rossen Stoyanchev
- See Also:
Decoder, Serialized Form
Constructor Summary
Constructors Constructor Description DecodingException(String msg)Create a new DecodingException.DecodingException(String msg, Throwable cause)Create a new DecodingException.
Method Summary
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Constructor Detail
DecodingException
public DecodingException(String msg)
Create a new DecodingException.- Parameters:
msg- the detail message
DecodingException
public DecodingException(String msg, @Nullable Throwable cause)
Create a new DecodingException.- Parameters:
msg- the detail messagecause- root cause for the exception, if any