mirror of
https://github.com/danbulant/discord.js
synced 2026-06-07 16:52:16 +00:00
parent
4adecf4aef
commit
91c9df2da3
1 changed files with 3 additions and 0 deletions
|
|
@ -45,6 +45,9 @@ class RequestHandler {
|
||||||
if (err.status === 429) {
|
if (err.status === 429) {
|
||||||
this.queue.unshift(item);
|
this.queue.unshift(item);
|
||||||
finish(Number(res.headers['retry-after']) + this.client.options.restTimeOffset);
|
finish(Number(res.headers['retry-after']) + this.client.options.restTimeOffset);
|
||||||
|
} else if (err.status === 500) {
|
||||||
|
this.queue.unshift(item);
|
||||||
|
finish(1e3 + this.client.options.restTimeOffset);
|
||||||
} else {
|
} else {
|
||||||
item.reject(err.status >= 400 && err.status < 500 ? new DiscordAPIError(res.request.path, res.body) : err);
|
item.reject(err.status >= 400 && err.status < 500 ? new DiscordAPIError(res.request.path, res.body) : err);
|
||||||
finish();
|
finish();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue