From 71ea0b07850914b7faae9cd738f5bbd1c2df6f26 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Mon, 1 May 2017 19:48:28 +0000 Subject: [PATCH] Webpack build for branch 11.1-dev: 61a081faa58e05f9aca067c19a2cb1958b333f15 --- discord.11.1-dev.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/discord.11.1-dev.js b/discord.11.1-dev.js index 1328a3cb..a4f6de6e 100644 --- a/discord.11.1-dev.js +++ b/discord.11.1-dev.js @@ -17150,13 +17150,15 @@ class DiscordAPIError extends Error { /** * Flattens an errors object returned from the API into an array. * @param {Object} obj Discord errors object - * @param {string} [key] idklol + * @param {string} [key] Used internally to determine key names of nested fields * @returns {string[]} */ static flattenErrors(obj, key = '') { let messages = []; + for (const k of Object.keys(obj)) { const newKey = key ? isNaN(k) ? `${key}.${k}` : `${key}[${k}]` : k; + if (obj[k]._errors) { messages.push(`${newKey}: ${obj[k]._errors.map(e => e.message).join(' ')}`); } else {