trap another error which was causing sporadic failures

This commit is contained in:
Caleb James DeLisle 2015-01-30 16:40:45 +01:00
parent c13bfe978a
commit 8c614f6b25
1 changed files with 8 additions and 3 deletions

View File

@ -142,9 +142,14 @@ console.log("[" + userPass + "] registered");
var sendMsgs = function () {
sendChannelMessage(ctx, chan, msg, function () {
chan.push(client);
ctx.store.getMessages(chan.name, function (msg) {
sendMsg(msg, socket);
});
try {
ctx.store.getMessages(chan.name, function (msg) {
sendMsg(msg, socket);
});
} catch (e) {
console.log(e.stack);
try { socket.close(); } catch (e) { }
}
});
};
if (newChan) {