Skip to content

Commit a207496

Browse files
committed
Return HTTP 400 on JSON parsing errors (fixes #258)
1 parent c28f9cf commit a207496

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package graphql.kickstart.servlet;
22

3+
import com.fasterxml.jackson.core.JsonProcessingException;
34
import graphql.GraphQLException;
45
import graphql.kickstart.execution.GraphQLInvoker;
56
import graphql.kickstart.execution.GraphQLQueryResult;
@@ -38,7 +39,7 @@ public void handle(HttpServletRequest request, HttpServletResponse response) thr
3839
);
3940
GraphQLInvocationInput invocationInput = invocationInputParser.getGraphQLInvocationInput(request, response);
4041
execute(invocationInput, request, response);
41-
} catch (GraphQLException e) {
42+
} catch (GraphQLException| JsonProcessingException e) {
4243
response.setStatus(STATUS_BAD_REQUEST);
4344
log.info("Bad request: cannot create invocation input parser", e);
4445
throw e;

0 commit comments

Comments
 (0)