diff --git a/js-build/localize-ftl.mjs b/js-build/localize-ftl.mjs index 7146d9b127..8d602e0d86 100644 --- a/js-build/localize-ftl.mjs +++ b/js-build/localize-ftl.mjs @@ -75,11 +75,17 @@ async function getFTL() { } } - const ftl = JSONToFtl(Object.fromEntries(translated), baseFTL); - const outFtlPath = join(getLocaleDir(locale), sourceFileBaseName + '.ftl'); - await fs.outputFile(outFtlPath, ftl); - onProgress(`${locale}/${sourceFileBaseName}.ftl`, null, 'localize'); - count++; + try { + const ftl = JSONToFtl(Object.fromEntries(translated), baseFTL); + const outFtlPath = join(getLocaleDir(locale), sourceFileBaseName + '.ftl'); + await fs.outputFile(outFtlPath, ftl); + onProgress(`${locale}/${sourceFileBaseName}.ftl`, null, 'localize'); + count++; + } + catch (e) { + e.message = `Failed to localize "${locale}": ${e.message}`; + throw e; + } } }