Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

throw inside responseMiddleware does not work as expected #429

Closed
aaronadamsCA opened this issue Jan 24, 2023 · 0 comments · Fixed by #810
Closed

throw inside responseMiddleware does not work as expected #429

aaronadamsCA opened this issue Jan 24, 2023 · 0 comments · Fixed by #810

Comments

@aaronadamsCA
Copy link

I think I should be able to throw errors inside response middleware. Simplest example:

  return new GraphQLClient(url, {
    responseMiddleware: async (response) => {
      throw new Error("TEST ERROR");
    },
  });

However this just results in a JS engine complaint, while execution continues unaffected:

Unhandled Promise Rejection: Error: TEST ERROR

I would not expect a thrown error to be turned into an unhandled promise rejection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants