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

Handle thrown values correctly even if they are not instances of Error. #6039

Closed
ardatan opened this issue Apr 8, 2024 · 0 comments · Fixed by #6038
Closed

Handle thrown values correctly even if they are not instances of Error. #6039

ardatan opened this issue Apr 8, 2024 · 0 comments · Fixed by #6038

Comments

@ardatan
Copy link
Owner

ardatan commented Apr 8, 2024

Some libraries like undici throw objects that are not Error instances when the response is tried to parse as JSON but failed.
In that case, executor prints an error like below;

NonErrorThrown: Unexpected error value: {...}
at toError (/usr/src/app/node_modules/graphql/jsutils/toError.js:16:7)
at locatedError (/usr/src/app/node_modules/graphql/error/locatedError.js:20:46)
at /usr/src/app/node_modules/@graphql-tools/executor/cjs/execution/execute.js:330:58
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async /usr/src/app/node_modules/@graphql-tools/executor/cjs/execution/promiseForObject.js:18:35
at async Promise.all (index 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant