mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 00:16:15 -04:00
SocketIORouter: Don't crash if message handler throws
This commit is contained in:
parent
320e5c1109
commit
9f9adb369b
2 changed files with 25 additions and 2 deletions
|
@ -78,7 +78,11 @@ exports.setSocketIO = (_io) => {
|
|||
return;
|
||||
}
|
||||
logger.debug(`from ${socket.id}: ${JSON.stringify(message)}`);
|
||||
await components[message.component].handleMessage(socket, message);
|
||||
try {
|
||||
await components[message.component].handleMessage(socket, message);
|
||||
} catch (err) {
|
||||
logger.error(`Error while handling message from ${socket.id}: ${err.stack || err}`);
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('disconnect', (reason) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue