Skip to content

Commit

Permalink
fix(@aws-amplify/pubsub): sending connection error to observable on A…
Browse files Browse the repository at this point in the history
…WSAppSyncProvider
  • Loading branch information
elorzafe committed Aug 16, 2019
1 parent 7f09c03 commit 8b7cac7
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions packages/pubsub/src/Providers/AWSAppSyncProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,17 @@ export class AWSAppSyncProvider extends MqttOverWSProvider {
// reconnect everything we have in the map
await Promise.all(map.map(async ([clientId, { url, topics }]) => {
// connect to new client
const client = await this.connect(clientId, {
clientId,
url,
});
let client = null;
try {
client = await this.connect(clientId, {
clientId,
url,
});
} catch (err) {
observer.error('Fail to connect');
observer.complete();
return Promise.resolve(undefined)
}

// subscribe to all topics for this client
// store topic-client mapping
Expand Down

0 comments on commit 8b7cac7

Please sign in to comment.