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
243 stars 114 forks source link

DataStore errorHandler cannot capture asynchronous mutation errors #1637

Closed HuiSF closed 1 year ago

HuiSF commented 2 years ago

Before opening, please confirm:

Language and Async Model

Java, Kotlin

Amplify Categories

DataStore

Gradle script dependencies

```groovy dependencies { implementation 'androidx.appcompat:appcompat:1.3.1' implementation 'com.google.android.material:material:1.4.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.1' implementation 'com.amplifyframework:aws-api:1.31.2' implementation 'com.amplifyframework:aws-datastore:1.31.2' testImplementation 'junit:junit:4.+' androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' } ```

Environment information

``` ------------------------------------------------------------ Gradle 6.7.1 ------------------------------------------------------------ Build time: 2020-11-16 17:09:24 UTC Revision: 2972ff02f3210d2ceed2f1ea880f026acfbab5c0 Kotlin: 1.3.72 Groovy: 2.5.12 Ant: Apache Ant(TM) version 1.10.8 compiled on May 10 2020 JVM: 1.8.0_292 (AdoptOpenJDK 25.292-b10) OS: Mac OS X 10.16 x86_64 ```

Please include any relevant guides or documentation you're referencing

No response

Describe the bug

DataStore allows developer to provide a custom errorHandler function. According to the library document, the errorHandler function is invoked for unrecoverable model synchronization errors. However, it never been invoked on any GraphQL error triggered my model mutation, and the library only prints an error log, but not providing an API to allow developers to catch this type off error.

Related amplify-ios issue: https://github.com/aws-amplify/amplify-ios/issues/1555

Reproduction steps (if applicable)

No response

Code Snippet

// Put your code below this line.

Log output

``` // Put your logs below this line ```

amplifyconfiguration.json

No response

GraphQL Schema

```graphql // Put your schema below this line ```

Additional information and screenshots

No response

applyinnovations commented 2 years ago

Hey @poojamat I have also logged the same issue on the amplify-js repository which is still open https://github.com/aws-amplify/amplify-js/issues/8891

github-actions[bot] commented 1 year ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.