This repository was archived by the owner on Sep 10, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Errors do not bubble up to formatError
#6
Labels
Comments
I noticed this and haven't had the time to dig into it, unfortunately. 😢 I'm putting together a roadmap for Q1 that includes figuring out why this stopped working and either patching it or looking for the root cause in |
As a workaround, we've decided on a |
Yeah, this seems like a valid workaround: In your data source model:
And when you need to call
Less than ideal, for sure. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Summary
I'm creating an issue here so you're aware, but I ultimately believe this is an issue with graphql-tools. When throwing a GrampsError, graphql-tools removes all properties except
error.message
and rethrows a new error. As a result, theformatError
provided by the@gramps/errors
package is useless.Walkthrough
When a GrampsError is thrown, it is caught by graphql-tools stitching logic and rethrown:
https://github.com/apollographql/graphql-tools/blob/master/src/stitching/errors.ts#L84
Later, the new error bubbles up to the formatError logic from
@gramps/errors
:However, the formatError function does not receive the expected GrampsErrors, rather, it receives a different error object transformed and rethrown by graphql-tools. It cannot log the targetEndpoint, statusCode, docsLink, and other fields on a GrampsError because the error has been caught and rethrown by graphql-tools.
I can write a short gist to reproduce it if you want.
The text was updated successfully, but these errors were encountered: