pass on error

This commit is contained in:
Amish Shah
2017-08-26 13:51:53 +01:00
parent 92a52460e1
commit 7d750c4680

View File

@@ -287,7 +287,10 @@ class Client extends EventEmitter {
if (typeof token !== 'string') throw new Error('TOKEN_INVALID');
token = token.replace(/^Bot\s*/i, '');
this.manager.connectToWebSocket(token, resolve, reject);
}).catch(() => this.destroy());
}).catch(e => {
this.destroy();
return Promise.reject(e);
});
}
/**