Skip to content

Commit

Permalink
Output 'result' from apollo-link-http error (#755)
Browse files Browse the repository at this point in the history
  • Loading branch information
skevy authored and timsuchanek committed Jul 6, 2018
1 parent c4d0371 commit e2cf374
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,11 @@ export function formatError(error, fetchingSchema: boolean = false) {

function extractMessage(error) {
if (error instanceof Error) {
// Errors from apollo-link-http may include a "result" object, which is a JSON response from
// the server. We should surface that to the client
if (!!error['result'] && typeof error['result'] === 'object') {
return (error as any).result
}
return error.message
}

Expand Down

0 comments on commit e2cf374

Please sign in to comment.