Skip to content

Commit

Permalink
feat: catch ws connect error
Browse files Browse the repository at this point in the history
  • Loading branch information
kungfuboy committed Sep 9, 2022
1 parent c295045 commit 789045c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/workbench/node/server/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ io.on('connection', (socket) => {
{}
),
});
ws.on('error', (err) => {
socket.emit('ws-client', { type: 'ws-connect-back', status: -1, content: err });
});
} catch (error) {
socket.emit('ws-client', { type: 'ws-connect-back', status: -1, content: error });
ws = null;
Expand Down

0 comments on commit 789045c

Please sign in to comment.