Skip to content

fix: throw Error instead of raw array for TypeScript compilation failures#160

Open
nikhiltelkar2005-glitch wants to merge 1 commit into
accordproject:mainfrom
nikhiltelkar2005-glitch:fix/compiler-error-object
Open

fix: throw Error instead of raw array for TypeScript compilation failures#160
nikhiltelkar2005-glitch wants to merge 1 commit into
accordproject:mainfrom
nikhiltelkar2005-glitch:fix/compiler-error-object

Conversation

@nikhiltelkar2005-glitch

Copy link
Copy Markdown

Resolves #128

Problem:
When a template formula contained invalid TypeScript, TemplateMarkToJavaScriptCompiler.compile() threw a raw Array<CompilerError>. This meant that any caller catching this error received [object Object] without a .message or a stack trace, making the rich error information collected by Twoslash inaccessible.

Solution:
Wrapped the raw errors array into a proper standard JavaScript Error object. The new error message groups the compilation failures by their nodeId and maps out each individual issue with its corresponding line and column number, making the failures much easier for users to debug.

@nikhiltelkar2005-glitch nikhiltelkar2005-glitch requested a review from a team June 9, 2026 11:02
…ures (accordproject#128)

Signed-off-by: Nikhil Telkar <nikhiltelkar2005@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant