Skip to content

Commit

Permalink
catch JsonParseException when parsing sync requests
Browse files Browse the repository at this point in the history
  • Loading branch information
lbalmaceda committed Oct 7, 2020
1 parent 23556a5 commit 66a4487
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ public void onResponse(Response response) {

@Override
protected Request doBuildRequest() throws RequestBodyBuildException {
boolean sendBody = method.equals("HEAD") || method.equals("GET");
boolean skipBody = method.equals("HEAD") || method.equals("GET");
return newBuilder()
.method(method, sendBody ? null : buildBody())
.method(method, skipBody ? null : buildBody())
.build();
}

Expand All @@ -114,7 +114,7 @@ public T execute() throws Auth0Exception {
try {
Reader charStream = body.charStream();
return getAdapter().fromJson(charStream);
} catch (IOException e) {
} catch (IOException | JsonParseException e) {
throw new Auth0Exception("Failed to parse response to request to " + url, e);
} finally {
closeStream(body);
Expand Down

0 comments on commit 66a4487

Please sign in to comment.