9 Commits
Author SHA1 Message Date
SnazzahandTTtie 67e0eeca29 fix(DiscordRESTError): properly parse request errors (#163)
# before
Invalid Form Body
  _errors: [object Object]

# after
Invalid Form Body
  Field "type" is required to determine the model type.

---------

Co-authored-by: TTtie <me@tttie.cz>
Ref: https://discord.com/developers/docs/reference#error-messages-request-error
2024-09-19 20:08:36 +00:00
TTtie 8ab6bbf910 chore: update to ESLint v9, add eqeqeq rule and disable prototype built-ins (#158)
Updates ESLint to v9, and adds an `eqeqeq` rule to enforce strict
equality usage across the codebase (`== null` is still allowed).

Additionally this disables prototype builtins in favor of Object.hasOwn.
2024-08-22 20:33:24 +00:00
CurtisandBsian 2712a85899 fix(rl): shared rl and retryAfter behaviour, header getter on httperror (#1344)
Co-authored-by: Bsian <chharry321@gmail.com>
2022-06-02 00:04:34 +01:00
Alex Taxiera 1dfc0f7813 Make custom Error properties writable (#536)
Fix compatibility with things that assume Node-like behavior on Error properties
2019-10-03 19:52:40 -07:00
LJ 2ddfd2d6d8 Upgrade to Node 8 (#408)
Finally.

Closes #402
2018-08-02 01:01:59 -07:00
Brandon Mendrick d02ca9f99f Use hasOwnProperty in for..in loops (#396) 2018-06-11 23:37:07 -07:00
abalabahaha fc198b9105 Fix infinite recursion in DiscordRESTError.flattenErrors() 2017-12-12 04:56:19 -08:00
abalabahaha a45b78779b Clean up DiscordRESTError 2017-12-07 02:36:20 -08:00
abalabahaha c29bbcf8db Much nicer REST errors (fix #329)
The request stacktrace is preserved, instead of some random http.IncomingMessage junk
Discord REST API v7 errors are flattened into the error message
`req`, `res`, and `response` are non-enumerable (hidden from console.log() and stuff like that)
2017-12-07 02:10:12 -08:00