mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 18:43:31 +01:00
Fix #1528
This commit is contained in:
@@ -359,13 +359,16 @@ class WebSocketConnection extends EventEmitter {
|
|||||||
* @param {Error} error Error that occurred
|
* @param {Error} error Error that occurred
|
||||||
*/
|
*/
|
||||||
onError(error) {
|
onError(error) {
|
||||||
|
if (error && error.message === 'uWs client connection error') {
|
||||||
|
this.reconnect();
|
||||||
|
return;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Emitted whenever the client's WebSocket encounters a connection error.
|
* Emitted whenever the client's WebSocket encounters a connection error.
|
||||||
* @event Client#error
|
* @event Client#error
|
||||||
* @param {Error} error The encountered error
|
* @param {Error} error The encountered error
|
||||||
*/
|
*/
|
||||||
this.client.emit(Constants.Events.ERROR, error);
|
this.client.emit(Constants.Events.ERROR, error);
|
||||||
if (error.message === 'uWs client connection error') this.reconnect();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user