diff options
author | Joas Schilling <coding@schilljs.com> | 2021-04-07 15:31:02 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-04-07 15:31:02 +0300 |
commit | 696dd81021ca5d6d33ee05fd4c09e33c84d2f53f (patch) | |
tree | e78b77fcfd70f3734135b1383c1b4e6092c3f067 /src/utils | |
parent | aa3c93e2ff50d0d920f332d417c3e37c135f9ead (diff) |
Handle failed server responses more gracefully
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/signaling.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/utils/signaling.js b/src/utils/signaling.js index a305bff32..4a93b33a7 100644 --- a/src/utils/signaling.js +++ b/src/utils/signaling.js @@ -439,13 +439,13 @@ Signaling.Internal.prototype._startPullingMessages = function() { // User navigated away in the meantime. Ignore } else if (axios.isCancel(error)) { console.debug('Pulling messages request was cancelled') - } else if (error.response && error.response.status === 409) { + } else if (error?.response?.status === 409) { // Participant joined a second time and this session was killed console.error('Session was killed but the conversation still exists') this._trigger('pullMessagesStoppedOnFail') EventBus.$emit('duplicateSessionDetected') - } else if (error.response && (error.response.status === 404 || error.response.status === 403)) { + } else if (error?.response?.status === 404 || error?.response?.status === 403) { // Conversation was deleted or the user was removed console.error('Conversation was not found anymore') EventBus.$emit('deletedSessionDetected') |