mirror of
https://github.com/danbulant/discord.js
synced 2026-06-10 02:02:40 +00:00
docs: add docstring to HTTPError
This commit is contained in:
parent
c63f15c8bc
commit
f75b80d96b
2 changed files with 6 additions and 2 deletions
|
|
@ -1,3 +1,7 @@
|
||||||
|
/**
|
||||||
|
* Represents a HTTP error from a request.
|
||||||
|
* @extends Error
|
||||||
|
*/
|
||||||
class HTTPError extends Error {
|
class HTTPError extends Error {
|
||||||
constructor(message, name, code, method, path) {
|
constructor(message, name, code, method, path) {
|
||||||
super(message);
|
super(message);
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ class RequestHandler {
|
||||||
// Set the manager's global timeout as the promise for other requests to "wait"
|
// Set the manager's global timeout as the promise for other requests to "wait"
|
||||||
this.manager.globalTimeout = Util.delayFor(this.retryAfter);
|
this.manager.globalTimeout = Util.delayFor(this.retryAfter);
|
||||||
|
|
||||||
// Wait for the global timeout to resolve before continue
|
// Wait for the global timeout to resolve before continuing
|
||||||
await this.manager.globalTimeout;
|
await this.manager.globalTimeout;
|
||||||
|
|
||||||
// Clean up global timeout
|
// Clean up global timeout
|
||||||
|
|
@ -140,7 +140,7 @@ class RequestHandler {
|
||||||
|
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
const success = await parseResponse(res);
|
const success = await parseResponse(res);
|
||||||
// Nothing wrong with the request, proceed with the next
|
// Nothing wrong with the request, proceed with the next one
|
||||||
resolve(success);
|
resolve(success);
|
||||||
return this.run();
|
return this.run();
|
||||||
} else if (res.status === 429) {
|
} else if (res.status === 429) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue