From d1aea23d39423547ba163491f3ebea76e8cfd98e Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 30 Dec 2023 17:31:22 -0400 Subject: write: static-build: catch errors in Template.resolve also --- src/write/build-modes/static-build.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/write/build-modes/static-build.js b/src/write/build-modes/static-build.js index eb2f6fe3..d2802f4e 100644 --- a/src/write/build-modes/static-build.js +++ b/src/write/build-modes/static-build.js @@ -301,9 +301,9 @@ export async function go({ wikiData, }); - let topLevelResult; + let pageHTML, oEmbedJSON; try { - topLevelResult = + const topLevelResult = quickEvaluate({ contentDependencies, extraDependencies: {...bound, appendIndexHTML}, @@ -311,6 +311,8 @@ export async function go({ name: page.contentFunction.name, args: page.contentFunction.args ?? [], }); + + ({pageHTML, oEmbedJSON} = html.resolve(topLevelResult)); } catch (error) { logError`\rError generating page: ${pathname}`; niceShowAggregate(error); @@ -318,8 +320,6 @@ export async function go({ return; } - const {pageHTML, oEmbedJSON} = html.resolve(topLevelResult); - return writePage({ pageHTML, oEmbedJSON, -- cgit 1.3.0-6-gf8a5