DiscordAPIError
classe · Source
Represents an error from the Discord API.
Extends: Error
Properties
method
The HTTP method used for the request Source
path
The path of the request relative to the HTTP endpoint Source
code
HTTP error code returned by Discord Source
httpStatus
The HTTP status code Source
requestData
The data associated with the request that caused this error Source
retries
The number of times this request has been retried Source
captcha
Captcha response data if the request requires a captcha. This object is passed to ClientOptions.captchaSolver when one is configured. Source
isBlockedByCloudflare
A special 40333 JSON error code is returned if your request is blocked by Cloudflare. This may be due to a malformed request or improper user agent. The response resembles a normal error structure: Source
Methods
flattenErrors
Flattens an errors object returned from the API into an array. Parameters
| Name | Type | Description |
|---|---|---|
obj | APIError | Discord errors object |
key? | string | Used internally to determine key names of nested fields |
Returns: Array<string>Source
_sanitizeRequestData
Sanitizes request data to prevent credential leakage in error logs Parameters
| Name | Type | Description |
|---|---|---|
data | * | Request data object |
Returns: * — Sanitized data Source