feat: catch ws connect error

This commit is contained in:
夜鹰 2022-09-09 11:40:00 +08:00
parent c2950453ff
commit 789045c372

View File

@ -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;