diff --git a/aws-datastore/src/main/java/com/amplifyframework/datastore/syncengine/SyncProcessor.java b/aws-datastore/src/main/java/com/amplifyframework/datastore/syncengine/SyncProcessor.java index d316c5494..2acf4acd7 100644 --- a/aws-datastore/src/main/java/com/amplifyframework/datastore/syncengine/SyncProcessor.java +++ b/aws-datastore/src/main/java/com/amplifyframework/datastore/syncengine/SyncProcessor.java @@ -53,6 +53,7 @@ import java.util.List; import java.util.Objects; import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Collectors; import io.reactivex.rxjava3.core.Completable; import io.reactivex.rxjava3.core.Flowable; @@ -320,8 +321,13 @@ private Single { Cancelable cancelable = appSync.sync(request, result -> { if (!result.hasData()) { + List errorStrings = result.getErrors().stream() + .map(GraphQLResponse.Error::toString) + .collect(Collectors.toList()); + String errors = String.join(",\n", errorStrings); + emitter.onError(new DataStoreException.IrRecoverableException( - "Empty response from AppSync.", "Report to AWS team." + "Received errors from AppSync: " + errors, "Report to AWS team." )); } else { if (result.hasErrors()) {