From eb47817581599aca05d15fddbba77b9c1e0d3051 Mon Sep 17 00:00:00 2001 From: Nikhil Telkar Date: Wed, 10 Jun 2026 12:12:34 +0530 Subject: [PATCH] =?UTF-8?q?fix:=20throw=20Error=20instead=20of=20raw=20arr?= =?UTF-8?q?ay=20for=20TypeScript=20compilation=20fail=E2=80=A6=20#128?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/TemplateMarkToJavaScriptCompiler.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/TemplateMarkToJavaScriptCompiler.ts b/src/TemplateMarkToJavaScriptCompiler.ts index abf1776..501374f 100644 --- a/src/TemplateMarkToJavaScriptCompiler.ts +++ b/src/TemplateMarkToJavaScriptCompiler.ts @@ -105,7 +105,13 @@ export class TemplateMarkToJavaScriptCompiler { return compiled; } else { - throw errors; + const messages = errors.map(e => { + const tsErrors = e.errors.map((tsErr: any) => { + return ` - ${tsErr.renderedMessage} (line: ${tsErr.line}, column: ${tsErr.character})`; + }).join('\n'); + return `Node ID: ${e.nodeId}\n${tsErrors}`; + }).join('\n\n'); + throw new Error(`Template compilation failed:\n${messages}`); } } }