-
-
Notifications
You must be signed in to change notification settings - Fork 816
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
Proper error handling [minor changes required]: fixing Object object error messages #1046
Comments
Very needed fix! |
Yes, this is really needed fix, as I have the same problem and proposed fix solves the problem |
Fix is perfect. Until it lands, I'm using the following equivalent workaround for our remote schemas: this.link = new ApolloLink((operation: Operation, forward?: NextLink) => {
return forward(operation).map(data => {
if(data.errors) {
for(const error of data.errors) {
if(!(error instanceof Error))
Object.setPrototypeOf(error, Error.prototype);
}
}
return data;
});
}).concat(link); |
Agreed! The errors keep getting swallowed and it's very annoying to go to the base layer application to try to figure out what the error is. |
Any progress with this issue? |
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
We recently released an alpha version of GraphQL Tools (#1308) that should fix the issue. Please update
Let us know if it solves the problem, we're counting for your feedback! :) |
Folded into #1306 |
@hwillson for quite a while me and other GraphQL users were dealing with unclear error messages.
To name a few:
dotansimha/graphql-binding#173
#743
(and maybe, but I'm not sure) #1037
The impossibility of using custom error codes that Apollo offers and dealing with weird error messages makes it hard to handle errors in a complex application.
Long story short, I guess I've managed to find the possible cause (at line
110
):https://github.com/apollographql/graphql-tools/blob/2394f0c3a8b30dbd4435dd21019727e76e61b892/src/stitching/errors.ts#L104-L113
If the
checkResultAndHandleErrors
is called and there's anerrors
array contains only one error the resulting error will be an instance not ofError
but ratherObject
, which will result in unexpected behaviour here - https://github.com/graphql/graphql-js/blob/c2bc19badebd208ff21849e8f579e7034631af42/src/execution/execute.js#L721 as a result of this logic https://github.com/graphql/graphql-js/blob/c2bc19badebd208ff21849e8f579e7034631af42/src/execution/execute.js#L753-L758In my opinion, the simplest solution would be to have something like this:
The text was updated successfully, but these errors were encountered: