Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
In both execute methods there is an IOException being thrown in https://github.com/apache/sling-org-apache-sling-graphql-core/blob/9989848de947bb4dc320b6b0f7cbcde810819728/src/main/java/org/apache/sling/graphql/core/servlet/GraphQLServlet.java#L323 and https://github.com/apache/sling-org-apache-sling-graphql-core/blob/9989848de947bb4dc320b6b0f7cbcde810819728/src/main/java/org/apache/sling/graphql/core/servlet/GraphQLServlet.java#L336 wrapping the underlying exception.
That is unexpected as IOException doesn't change the response status (i.e. stays with default 200) and also doesn't leverage the Sling error handler for rendering a response. Instead in most cases a blank response will hit the client.
IOException should only be thrown in case one cannot write to the underlying servlet response stream/writer. For all other cases other exception classes should be used!