mirror of
https://github.com/danbulant/discord.js
synced 2026-05-24 20:42:27 +00:00
fix infinte loop issue (#1488)
This commit is contained in:
parent
342c644043
commit
4422f2aa8a
1 changed files with 2 additions and 0 deletions
|
|
@ -29,6 +29,8 @@ class DiscordAPIError extends Error {
|
|||
|
||||
if (obj[k]._errors) {
|
||||
messages.push(`${newKey}: ${obj[k]._errors.map(e => e.message).join(' ')}`);
|
||||
} else if (obj[k].code && obj[k].message) {
|
||||
messages.push(`${obj[k].code}: ${obj[k].message}`);
|
||||
} else {
|
||||
messages = messages.concat(this.flattenErrors(obj[k], newKey));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue