Closed tokarenko closed 1 year ago
Ah, this is because you have performed another mapping operation with .ifFailure(String.class, r -> {})
, so the parsing to String
worked fine, I totally get why you want the original error though. Let me think about that
If you had just used ifFailure(r -> {})
without the extra mapping, then you would see the error and the original body is also on the parsingException
this is complete in 3.14.0 / 4.0.0-RC6. Note that if the 2nd mapping operation fails due to a parsing error you will get THAT error and not the previous one.
Describe the bug getParsingError() is null when Jackson parser fails at least for the following errors:
int
from String "2022-09-13T10:06:35.847+0300": not a validint
valuejava.util.ArrayList<Object>
from Object value (tokenJsonToken.START_OBJECT
)To Reproduce Steps to reproduce the behavior: In the below code failureMessage does not contain parsing error even if Jackson parser fails.
I was able to retreive errors only via direct call to com.fasterxml.jackson.databind.ObjectMapper:
Book book = mapper.readValue(Unirest.get("https://...").asString().getBody(), Book.class);
Expected behavior getParsingError() returns UnirestParsingException when Jackson parser fails
Screenshots N/A
Environmental Data:
Additional context Add any other context about the problem here.