mirror of
https://github.com/danbulant/discord.js
synced 2026-05-24 20:42:27 +00:00
Fix #1528
This commit is contained in:
parent
4292134647
commit
ee679c7320
1 changed files with 4 additions and 1 deletions
|
|
@ -359,13 +359,16 @@ class WebSocketConnection extends EventEmitter {
|
|||
* @param {Error} error Error that occurred
|
||||
*/
|
||||
onError(error) {
|
||||
if (error && error.message === 'uWs client connection error') {
|
||||
this.reconnect();
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* Emitted whenever the client's WebSocket encounters a connection error.
|
||||
* @event Client#error
|
||||
* @param {Error} error The encountered error
|
||||
*/
|
||||
this.client.emit(Constants.Events.ERROR, error);
|
||||
if (error.message === 'uWs client connection error') this.reconnect();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue