Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #441 from alien299/alien299-WebsocketErrorPatch
Browse files Browse the repository at this point in the history
Update cirrus.js - More informative error messages - Fixes #184
  • Loading branch information
mcottontensor committed Dec 10, 2023
2 parents 28e7c0c + e5f2ff8 commit c05f3b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions SignallingWebServer/cirrus.js
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ streamerServer.on('connection', function (ws, req) {
console.error(`streamer ${streamer.id} connection error: ${error}`);
onStreamerDisconnected(streamer);
try {
ws.close(1006 /* abnormal closure */, error);
ws.close(1006 /* abnormal closure */, `streamer ${streamer.id} connection error: ${error}`);
} catch(err) {
console.error(`ERROR: ws.on error: ${err.message}`);
}
Expand Down Expand Up @@ -823,7 +823,7 @@ sfuServer.on('connection', function (ws, req) {
console.error(`SFU connection error: ${error}`);
onSFUDisconnected(playerComponent);
try {
ws.close(1006 /* abnormal closure */, error);
ws.close(1006 /* abnormal closure */, `SFU connection error: ${error}`);
} catch(err) {
console.error(`ERROR: ws.on error: ${err.message}`);
}
Expand Down Expand Up @@ -951,7 +951,7 @@ playerServer.on('connection', function (ws, req) {

ws.on('error', function(error) {
console.error(`player ${playerId} connection error: ${error}`);
ws.close(1006 /* abnormal closure */, error);
ws.close(1006 /* abnormal closure */, `player ${playerId} connection error: ${error}`);
onPlayerDisconnected(playerId);

console.logColor(logging.Red, `Trying to reconnect...`);
Expand Down

0 comments on commit c05f3b1

Please sign in to comment.