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?
I'm fetching a query in Apollo and the result handler provides an optional result and error object.
apollo.fetch(query: SampleQuery()) { (result, error) inIf the error is non-nil I present this error's
localizedDescriptionto the user (and if it's not then I check if the result's errors is not empty and use the first error'slocalizedDescription). At times the user can be shown a very unfriendly message from that outer error, such asIt seems this is the case when the error is a
GraphQLHTTPResponseError. Could we get a friendlylocalizedDescriptionout of these errors?