mirror of
https://github.com/moparisthebest/kaiwa
synced 2024-12-25 08:58:53 -05:00
Log websocket disconnect errors
This commit is contained in:
parent
a772ccb57c
commit
bcce90bcdf
@ -78,8 +78,11 @@ module.exports = function (client, app) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
client.on('disconnected', function () {
|
client.on('disconnected', function (err) {
|
||||||
me.connected = false;
|
me.connected = false;
|
||||||
|
if (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
if (!app.hasConnected) {
|
if (!app.hasConnected) {
|
||||||
window.location = '/login';
|
window.location = '/login';
|
||||||
}
|
}
|
||||||
|
@ -5098,12 +5098,12 @@ WSConnection.prototype.connect = function (opts) {
|
|||||||
self.conn = new WebSocket(opts.wsURL, 'xmpp');
|
self.conn = new WebSocket(opts.wsURL, 'xmpp');
|
||||||
self.conn.onerror = function (e) {
|
self.conn.onerror = function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
self.emit('disconnected', self);
|
self.emit('disconnected', e);
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
self.conn.onclose = function () {
|
self.conn.onclose = function () {
|
||||||
self.emit('disconnected', self);
|
self.emit('disconnected');
|
||||||
};
|
};
|
||||||
|
|
||||||
self.conn.onopen = function () {
|
self.conn.onopen = function () {
|
||||||
|
Loading…
Reference in New Issue
Block a user