runtime exception now catching

This commit is contained in:
Gavriil Sitnikov 2015-11-17 17:25:31 +03:00
parent 5bd47bd293
commit cd6b074dc3
1 changed files with 3 additions and 1 deletions

View File

@ -126,8 +126,10 @@ public abstract class AbstractHttpRequest<T> {
T result;
try {
result = getParser().parseAndClose(byteArrayInputStream, charset, responseResultType);
} catch (RuntimeException throwable) {
throw new ShouldNotHappenException("Runtime exception during response parsing " + getUrl(), throwable);
} catch (JsonProcessingException ex) {
throw new ShouldNotHappenException("Invalid response for request " + getUrl(), ex);
throw new ShouldNotHappenException("Parsing exception during response parsing " + getUrl(), ex);
}
if (result == null) {
throw new ShouldNotHappenException("Response is null for request " + getUrl());