From 0d0f47d8b8e84a765fda54af05b11e61a9ee1fdb Mon Sep 17 00:00:00 2001 From: Travis CI Date: Mon, 1 May 2017 19:52:11 +0000 Subject: [PATCH] Webpack build for branch master: e124ada962bfaf66fa263c3543461c1a6b9059da --- discord.master.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/discord.master.js b/discord.master.js index 2a358d7e..bce0e18f 100644 --- a/discord.master.js +++ b/discord.master.js @@ -17211,13 +17211,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 {