Skip to content

Commit

Permalink
only catch IOException when closing the response body
Browse files Browse the repository at this point in the history
  • Loading branch information
lbalmaceda committed Mar 1, 2017
1 parent 4314c70 commit 36aca42
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ protected U parseUnsuccessfulResponse(Response response) {
stringPayload = body.string();
Type mapType = new TypeToken<Map<String, Object>>() {
}.getType();
Map<String, Object> mapPayload = gson.fromJson(stringPayload, mapType);
Map<String, Object> mapPayload = gson.fromJson(body.charStream(), mapType);
return errorBuilder.from(mapPayload);
} catch (JsonSyntaxException e) {
return errorBuilder.from(stringPayload, response.code());
Expand All @@ -141,7 +141,7 @@ protected U parseUnsuccessfulResponse(Response response) {
} finally {
try {
body.close();
} catch (Exception ignored) {
} catch (IOException ignored) {
}
}
}
Expand Down

0 comments on commit 36aca42

Please sign in to comment.