Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6451779

Browse files
authoredNov 13, 2020
Merge pull request #275 from alexandreBaronZnk/bugfix/250-httprequesthandlerimpl-doesnt-reponse-error-with-detail
Refactor log messages into HttpRequestHandlerImpl #250
2 parents 6453d5f + bde3e7d commit 6451779

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed
 

‎graphql-java-servlet/src/main/java/graphql/kickstart/servlet/HttpRequestHandlerImpl.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,28 +37,22 @@ public void handle(HttpServletRequest request, HttpServletResponse response) thr
3737
execute(invocationInput, request, response);
3838
} catch (GraphQLException e) {
3939
response.setStatus(STATUS_BAD_REQUEST);
40-
log.info("Bad request: cannot create invocation input parser", e);
40+
log.info("Bad request: cannot handle http request", e);
4141
throw e;
4242
} catch (Throwable t) {
4343
response.setStatus(500);
44-
log.info("Bad request: cannot create invocation input parser", t);
44+
log.error("Cannot handle http request", t);
4545
throw t;
4646
}
4747
}
4848

4949
private void execute(GraphQLInvocationInput invocationInput, HttpServletRequest request,
50-
HttpServletResponse response) {
51-
try {
50+
HttpServletResponse response) throws IOException {
5251
GraphQLQueryResult queryResult = invoke(invocationInput, request, response);
5352

5453
QueryResponseWriter queryResponseWriter = QueryResponseWriter.createWriter(queryResult, configuration.getObjectMapper(),
5554
configuration.getSubscriptionTimeout());
5655
queryResponseWriter.write(request, response);
57-
} catch (Throwable t) {
58-
response.setStatus(STATUS_BAD_REQUEST);
59-
log.info("Bad GET request: path was not \"/schema.json\" or no query variable named \"query\" given");
60-
log.debug("Possibly due to exception: ", t);
61-
}
6256
}
6357

6458
private GraphQLQueryResult invoke(GraphQLInvocationInput invocationInput, HttpServletRequest request,

0 commit comments

Comments
 (0)
Please sign in to comment.