aws-amplify / amplify-android

The fastest and easiest way to use AWS from your Android app.
https://docs.amplify.aws/lib/q/platform/android/
Apache License 2.0
249 stars 117 forks source link

fix(datastore): List errors that are returned from AppSync #2801

Closed mattcreaser closed 6 months ago

mattcreaser commented 6 months ago

Issue #, if available:

Description of changes: Improve logging of errors returned from AppSync. We previously erroneously reported a response with errors as an "empty response" which limits ability to diagnose the error. We will now include the actual error in the log message.

Before:

IrRecoverableException{message=Empty response from AppSync., cause=null, recoverySuggestion=Report to AWS team.}

After:

IrRecoverableException{message=Received errors from AppSync: GraphQLResponse.Error{message='Not Authorized to access syncGuests on type Query', locations='[GraphQLLocation{line='2', column='3'}]', path='[GraphQLPathSegment{value='syncGuests'}]', extensions='{errorInfo=null, data=null, errorType=Unauthorized}'}, cause=null, recoverySuggestion=Report to AWS team.}

How did you test these changes? (Please add a line here how the changes were tested)

Documentation update required?

General Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.