GraphQLServletListener.RequestCallback.onError not being called even though an exception throws
muhdalavu opened this issue · 2 comments
muhdalavu commented
Describe the bug
I should be able to handle the Exception from the GraphQLServletListener
To Reproduce
Steps to reproduce the behavior:
In Asynchronus Excecution, Even there are exception in the response, the onError callback not being called.
Expected behavior
OnError mothod should be called
[In the below code the exceptionlly method not being called.]
file
private CompletableFuture<Void> handle(
FutureExecutionResult futureResult,
HttpServletRequest request,
HttpServletResponse response,
ListenerHandler listenerHandler) {
return futureResult
.thenApplyQueryResult()
.thenAccept(
it -> {
listenerHandler.beforeFlush();
writeResultResponse(futureResult.getInvocationInput(), it, request, response);
})
.thenAccept(it -> listenerHandler.onSuccess())
.exceptionally(
t ->
writeErrorResponse(
futureResult.getInvocationInput(), request, response, listenerHandler, t))
.thenAccept(it -> listenerHandler.onFinally());
}
oliemansm commented
Do you have an example project or even better a unit test in a fork of this project reproducing this issue?
federicorispo commented
I think we can close this bug since the code is changed and now the handle
method calls the listenerHandler.onError
when an exception is catched.