mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 14:02:02 +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) {
|
if (obj[k]._errors) {
|
||||||
messages.push(`${newKey}: ${obj[k]._errors.map(e => e.message).join(' ')}`);
|
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 {
|
} else {
|
||||||
messages = messages.concat(this.flattenErrors(obj[k], newKey));
|
messages = messages.concat(this.flattenErrors(obj[k], newKey));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue