From 4252cef4fbf9e5c1fcca3a1fdd818080c1d3124c Mon Sep 17 00:00:00 2001 From: Jan Martiska Date: Mon, 13 Feb 2023 09:31:31 +0100 Subject: [PATCH] Only log at DEBUG if graphql endpoint already finished the HTTP response --- .../runtime/SmallRyeGraphQLExecutionHandler.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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); + } + } } }