Skip to content

Commit

Permalink
Add error handler to ws connection
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinLinus authored Oct 13, 2022
1 parent 070f6a9 commit 2e0619f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class SnapdropServer {
_onConnection(peer) {
this._joinRoom(peer);
peer.socket.on('message', message => this._onMessage(peer, message));
peer.socket.on('error', console.error);
this._keepAlive(peer);

// send displayName
Expand Down Expand Up @@ -288,4 +289,4 @@ Object.defineProperty(String.prototype, 'hashCode', {
}
});

const server = new SnapdropServer(process.env.PORT || 3000);
const server = new SnapdropServer(process.env.PORT || 3000);

1 comment on commit 2e0619f

@05077Hhhh
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

هلا

Please sign in to comment.