From 10174e6b269c8479ebeb12b3e76a694327aafd73 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 2 Jun 2024 22:27:50 -0300 Subject: upd8: report precache errors more nicely --- src/upd8.js | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/src/upd8.js b/src/upd8.js index 82ba8a6c..9e4ef4fb 100755 --- a/src/upd8.js +++ b/src/upd8.js @@ -1543,14 +1543,31 @@ async function main() { ]), }; - for (const [wikiDataKey, properties] of Object.entries(commonDataMap)) { - const thingData = wikiData[wikiDataKey]; - const allProperties = new Set(['name', 'directory', ...properties]); - for (const thing of thingData) { - for (const property of allProperties) { - void thing[property]; + try { + for (const [wikiDataKey, properties] of Object.entries(commonDataMap)) { + const thingData = wikiData[wikiDataKey]; + const allProperties = new Set(['name', 'directory', ...properties]); + for (const thing of thingData) { + for (const property of allProperties) { + void thing[property]; + } } } + } catch (error) { + if (!paragraph) console.log(''); + niceShowAggregate(error); + console.log(''); + + logError`There was an error precaching internal data objects.`; + fileIssue(); + + Object.assign(stepStatusSummary.precacheCommonData, { + status: STATUS_FATAL_ERROR, + annotation: `see log for details`, + timeEnd: Date.now(), + }); + + return false; } Object.assign(stepStatusSummary.precacheCommonData, { -- cgit 1.3.0-6-gf8a5