Skip to content

Commit

Permalink
try ... catch ...
Browse files Browse the repository at this point in the history
  • Loading branch information
PRO-2684 committed Sep 26, 2024
1 parent 86a5b00 commit f1165e0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,13 @@ async function updateStyle(absPath, webContent) {
}
}
if (meta.preprocessor === "stylus") {
css = await renderStylus(absPath, css, meta.vars);
try {
css = await renderStylus(absPath, css, meta.vars);
} catch (err) {
log(`Failed to render ${absPath}:`, err);
css = `/* Stylus 编译失败: ${err} */`;
meta.name += " (编译失败)";
}
}
// Send message to renderer
const msg = { path: absPath, enabled, css, meta };
Expand Down

0 comments on commit f1165e0

Please sign in to comment.