Skip to content

GraphQLServletListener.RequestCallback.onError not being called even though an exception throws #451

Closed
@muhdalavu

Description

@muhdalavu

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());
  }

Screenshot 2022-06-23 at 7 24 41 PM

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions