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:
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;
|
||||
if (err) {
|
||||
console.error(err);
|
||||
}
|
||||
if (!app.hasConnected) {
|
||||
window.location = '/login';
|
||||
}
|
||||
|
@ -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 () {
|
||||
|
Loading…
Reference in New Issue
Block a user