1
0
mirror of https://github.com/moparisthebest/kaiwa synced 2024-12-23 16:18:48 -05:00

Log websocket disconnect errors

This commit is contained in:
Lance Stout 2013-09-17 11:48:03 -07:00
parent a772ccb57c
commit bcce90bcdf
2 changed files with 6 additions and 3 deletions

View File

@ -78,8 +78,11 @@ module.exports = function (client, app) {
});
});
client.on('disconnected', function () {
client.on('disconnected', function (err) {
me.connected = false;
if (err) {
console.error(err);
}
if (!app.hasConnected) {
window.location = '/login';
}

View File

@ -5098,12 +5098,12 @@ WSConnection.prototype.connect = function (opts) {
self.conn = new WebSocket(opts.wsURL, 'xmpp');
self.conn.onerror = function (e) {
e.preventDefault();
self.emit('disconnected', self);
self.emit('disconnected', e);
return false;
};
self.conn.onclose = function () {
self.emit('disconnected', self);
self.emit('disconnected');
};
self.conn.onopen = function () {