Webpack build for branch wsrewrite: a75d2efc291481f0cc96873bfd7aecca67e20291

This commit is contained in:
Travis CI 2017-04-24 20:29:15 +00:00
parent 3c5bf35210
commit 595c3779ba
2 changed files with 37 additions and 29 deletions

View file

@ -24520,7 +24520,10 @@ class SequentialRequestHandler extends RequestHandler {
execute(item) { execute(item) {
this.busy = true; this.busy = true;
return new Promise(resolve => { return new Promise(resolve => {
item.request.gen().end((err, res) => { item.request
.gen()
.on('error', e => item.reject(e))
.end((err, res) => {
if (res && res.headers) { if (res && res.headers) {
this.requestLimit = Number(res.headers['x-ratelimit-limit']); this.requestLimit = Number(res.headers['x-ratelimit-limit']);
this.requestResetTime = Number(res.headers['x-ratelimit-reset']) * 1000; this.requestResetTime = Number(res.headers['x-ratelimit-reset']) * 1000;
@ -24656,6 +24659,11 @@ class WebSocketManager extends EventEmitter {
return this.connection.destroy(); return this.connection.destroy();
} }
send(packet) {
if (!this.connection) return this.debug('No connection to websocket');
return this.connection.send(packet);
}
connect(gateway) { connect(gateway) {
if (!this.connection) { if (!this.connection) {
this.connection = new WebSocketConnection(this, gateway); this.connection = new WebSocketConnection(this, gateway);

File diff suppressed because one or more lines are too long