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

User-friendly localizedDescription from query fetch Error #477

Closed
jordanhbuiltbyhq opened this issue Mar 22, 2019 · 2 comments
Closed

User-friendly localizedDescription from query fetch Error #477

jordanhbuiltbyhq opened this issue Mar 22, 2019 · 2 comments
Labels
enhancement Issues outlining new things we want to do or things that will make our lives as devs easier

Comments

@jordanhbuiltbyhq
Copy link

I'm fetching a query in Apollo and the result handler provides an optional result and error object.

apollo.fetch(query: SampleQuery()) { (result, error) in

If the error is non-nil I present this error's localizedDescription to the user (and if it's not then I check if the result's errors is not empty and use the first error's localizedDescription). At times the user can be shown a very unfriendly message from that outer error, such as

Received error response (500 internal server error): {"errors":[{"message":"Context creation failed: Invalid app info headers.","extensions":{"code":"INTERNAL_SERVER_ERROR"}}]}

It seems this is the case when the error is a GraphQLHTTPResponseError. Could we get a friendly localizedDescription out of these errors?

@designatednerd
Copy link
Contributor

@jordanhbuiltbyhq - I think I saw some changes around this recently - can you let us know how this is working for you on version 0.11.1 or higher?

@designatednerd designatednerd added the enhancement Issues outlining new things we want to do or things that will make our lives as devs easier label Jul 15, 2019
@designatednerd
Copy link
Contributor

Since I haven't heard back here in a couple of weeks, I'm going to close this issue out. If you're still having problems with newer versions of Apollo, please open a new issue. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues outlining new things we want to do or things that will make our lives as devs easier
Projects
None yet
Development

No branches or pull requests

2 participants