added try catch to socket calls

v1.18.x
Baris Soner Usakli 11 years ago
parent b303fdcfd7
commit e16c3f3f80

@ -162,10 +162,18 @@ Sockets.init = function() {
// Call the requested method // Call the requested method
if (Namespaces[namespace].before) { if (Namespaces[namespace].before) {
Namespaces[namespace].before(sessionData, function() { Namespaces[namespace].before(sessionData, function() {
methodToCall.apply(Namespaces, socketArgs); try {
methodToCall.apply(Namespaces, socketArgs);
} catch (e) {
winston.error(e.message);
}
}); });
} else { } else {
methodToCall.apply(Namespaces, socketArgs); try {
methodToCall.apply(Namespaces, socketArgs);
} catch (e) {
winston.error(e.message);
}
} }
// winston.info('[socket.io] Executing: ' + payload.name); // winston.info('[socket.io] Executing: ' + payload.name);
} else { } else {

Loading…
Cancel
Save