Skip to content

Commit

Permalink
fix: prevent live-sample render errors killing the whole build (#9155)
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoMcA authored Jun 24, 2023
1 parent 458e4cc commit c99d7fe
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions kumascript/src/live-sample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,17 @@ export async function buildLiveSamplePages(uri, title, $, rawBody) {
// It's deprecated but we still apply a workaround for now.
slug = iframeSlug;
result.slug = iframeSlug;
const [c] = await render(slug);
ctx = c;
try {
const [c] = await render(slug);
ctx = c;
} catch (e) {
result.flaw = new MacroLiveSampleError(
e,
rawBody,
JSON.parse($(iframe).attr("data-token"))
);
return result;
}
}
const tool = new HTMLTool(ctx, slug);
let sampleData;
Expand Down

0 comments on commit c99d7fe

Please sign in to comment.