added try catch to socket calls

This commit is contained in:
Baris Soner Usakli
2014-01-15 13:23:53 -05:00
parent b303fdcfd7
commit e16c3f3f80

View File

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