diff --git a/cli.mjs b/cli.mjs index 3bf9d90..a9798d7 100644 --- a/cli.mjs +++ b/cli.mjs @@ -31,7 +31,14 @@ const args = process.argv const fileName = args[0]; const scriptArgs = args.slice(1); -const rendered = await renderFile(fileName); +let rendered; +try { + rendered = await renderFile(fileName); +} catch (e) { + console.log("Error Rendering Template:") + console.log(e?.message || "Unknown Error"); + process.exit(0); +} if (compileOnly) { process.stdout.write(rendered);