mirror of
https://github.com/danbulant/discord.js
synced 2026-05-24 20:42:27 +00:00
invalid token errors not rejected properly (#1478)
* ready event will now throw errors properly * ws login rejection fix
This commit is contained in:
parent
83f2c62c3f
commit
d11a658f40
1 changed files with 1 additions and 1 deletions
|
|
@ -43,7 +43,7 @@ class ClientManager {
|
|||
const gateway = `${res.url}/?v=${protocolVersion}&encoding=${WebSocketConnection.ENCODING}`;
|
||||
this.client.emit(Constants.Events.DEBUG, `Using gateway ${gateway}`);
|
||||
this.client.ws.connect(gateway);
|
||||
this.client.ws.once('close', event => {
|
||||
this.client.ws.connection.once('close', event => {
|
||||
if (event.code === 4004) reject(new Error(Constants.Errors.BAD_LOGIN));
|
||||
if (event.code === 4010) reject(new Error(Constants.Errors.INVALID_SHARD));
|
||||
if (event.code === 4011) reject(new Error(Constants.Errors.SHARDING_REQUIRED));
|
||||
|
|
|
|||
Loading…
Reference in a new issue