Skip to content

Commit bde3e7d

Browse files
Refactor log messages into HttpRequestHandlerImpl #250
1 parent 6453d5f commit bde3e7d

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

+3-9
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)