How do you catch js.io error messages?

8 views
Skip to first unread message

Niklas B

unread,
Sep 10, 2011, 2:50:52 PM9/10/11
to js.io
HI,

What is the best way to trap/catch all "throw logger.erro" from js.io?
Thinking about:

this.onDisconnect = function(err) {
var wasConnected = this._state == exports.STATE.CONNECTED;
this._state = exports.STATE.DISCONNECTED;

try {
this._protocol._connectionLost(err, wasConnected);
} catch(e) {
throw logger.error(e);
}
}

I would like to wrap it in my error logger so it doesn't trigger a
browser JS error.

Regards,
NIklas
Reply all
Reply to author
Forward
0 new messages