diff options
author | Joas Schilling <coding@schilljs.com> | 2021-06-07 17:02:52 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-06-14 12:33:13 +0300 |
commit | cd7e849d78a92ccecb84117c96575a2aa233cdaa (patch) | |
tree | 0925b28256e23240778ed4cb80eb70e42fc39d09 /docs | |
parent | 2a702c6da10f1b6174f795eadd999a8774eb830d (diff) |
Catch the exception on creating the signaling connection
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/Talkbuchet.js | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/docs/Talkbuchet.js b/docs/Talkbuchet.js index 45642fc1f..01c07adf4 100644 --- a/docs/Talkbuchet.js +++ b/docs/Talkbuchet.js @@ -505,7 +505,13 @@ function listenToPublisherConnectionChanges() { async function initPublishers() { for (let i = 0; i < publishersCount; i++) { const signalingSettings = await getSignalingSettings(user, password, token) - const signaling = new Signaling(user, signalingSettings) + let signaling = null + try { + signaling = new Signaling(user, signalingSettings) + } catch (exception) { + console.error('Publisher ' + i + ' init error: ' + exception) + continue + } const [publisherSessionId, publisher] = await newPublisher(signalingSettings, signaling, stream) @@ -553,7 +559,13 @@ async function initSubscribers() { // The same signaling session can be shared between subscribers to // different publishers. const signalingSettings = await getSignalingSettings(user, password, token) - const signaling = new Signaling(user, signalingSettings) + let signaling = null + try { + signaling = new Signaling(user, signalingSettings) + } catch (exception) { + console.error('Subscriber ' + i + ' init error: ' + exception) + continue + } await signaling.getSessionId() |