File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
aws-datastore/src/main/java/com/amplifyframework/datastore/syncengine Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 5353import java .util .List ;
5454import java .util .Objects ;
5555import java .util .concurrent .atomic .AtomicReference ;
56+ import java .util .stream .Collectors ;
5657
5758import io .reactivex .rxjava3 .core .Completable ;
5859import io .reactivex .rxjava3 .core .Flowable ;
@@ -320,8 +321,13 @@ private <T extends Model> Single<GraphQLResponse<PaginatedResult<ModelWithMetada
320321 return Single .create (emitter -> {
321322 Cancelable cancelable = appSync .sync (request , result -> {
322323 if (!result .hasData ()) {
324+ List <String > errorStrings = result .getErrors ().stream ()
325+ .map (GraphQLResponse .Error ::toString )
326+ .collect (Collectors .toList ());
327+ String errors = String .join (",\n " , errorStrings );
328+
323329 emitter .onError (new DataStoreException .IrRecoverableException (
324- "Empty response from AppSync." , "Report to AWS team."
330+ "Received errors from AppSync: " + errors , "Report to AWS team."
325331 ));
326332 } else {
327333 if (result .hasErrors ()) {
You can’t perform that action at this time.
0 commit comments