diff --git a/extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLExecutionHandler.java b/extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLExecutionHandler.java index d5d19737bb25e..49b2cc60a20a4 100644 --- a/extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLExecutionHandler.java +++ b/extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLExecutionHandler.java @@ -339,9 +339,16 @@ public void write(ExecutionResponse er) { response.setStatusCode(500) .end(); } else { - response.setStatusCode(200) - .setStatusMessage(OK) - .end(Buffer.buffer(er.getExecutionResultAsString(), requestedCharset)); + try { + response.setStatusCode(200) + .setStatusMessage(OK) + .end(Buffer.buffer(er.getExecutionResultAsString(), requestedCharset)); + } catch (IllegalStateException ise) { + // The application already finished the request by itself for some reason + if (log.isDebugEnabled()) { + log.debug("Cannot write response", ise); + } + } } }