Skip to content

Commit

Permalink
fix(@aws-amplify/datastore): call disconnectionHandler on subscriptio…
Browse files Browse the repository at this point in the history
…n error (aws-amplify#6366)
  • Loading branch information
nubpro authored Jul 21, 2020
1 parent d14c076 commit a7feace
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/datastore/src/sync/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,8 @@ export class SyncEngine {
},
error: err => {
reject(err);
this.disconnectionHandler(datastoreConnectivity);
const handleDisconnect = this.disconnectionHandler(datastoreConnectivity);
handleDisconnect(err);
},
});
});
Expand Down
4 changes: 3 additions & 1 deletion packages/datastore/src/sync/processors/subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,11 +357,13 @@ class SubscriptionProcessor {
errors: [],
},
} = subscriptionError;
logger.warn(message);
logger.warn('subscriptionError', message);

if (typeof subscriptionReadyCallback === 'function') {
subscriptionReadyCallback();
}

observer.error(message);
},
})
);
Expand Down

0 comments on commit a7feace

Please sign in to comment.