From e39730d52e8fa3d5ca0b5d8955d79f64aaef414e Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 11 Oct 2017 09:56:38 +0100 Subject: [PATCH] Say which translation file failed (#5196) So we can see which i18n file is invalid when it fails --- scripts/copy-res.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/copy-res.js b/scripts/copy-res.js index 59f71692..b461d030 100755 --- a/scripts/copy-res.js +++ b/scripts/copy-res.js @@ -160,10 +160,15 @@ function genLangFile(lang, dest) { let translations = {}; [reactSdkFile, riotWebFile].forEach(function(f) { if (fs.existsSync(f)) { - Object.assign( - translations, - JSON.parse(fs.readFileSync(f).toString()) - ); + try { + Object.assign( + translations, + JSON.parse(fs.readFileSync(f).toString()) + ); + } catch (e) { + console.error("Failed: "+f, e); + throw e; + } } });