You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently problems like overflow for numeric type (when JSON number value exceeds range of requested target type like int) simply use JsonParseException to indicate the problem (both at streaming and databind level).
But it would be better if we could use more targeted exception, to let calling application potentially handle problems differently. We can also add some metadata about type of failure, such as initial token type and expected target type.
It is also true that coercion failures -- where we start from valid JSON value, but fail to convert into desired target type -- are not parse (decode) problems at all, but rather mismatch problems.
So let's add something like InputCoercionException, which extends JsonProcessingException, but not JsonParseException.
With 3.x we may want to tackle other problems: for example, lack of context for "lower level" JsonProcessingExceptions (compared to JsonMappingException)