Skip to content

fix: propagate mermaid-cli stderr in rendering errors#83

Merged
veelenga merged 3 commits intoveelenga:mainfrom
aodecipher:fix/propagate-mermaid-cli-errors
Mar 10, 2026
Merged

fix: propagate mermaid-cli stderr in rendering errors#83
veelenga merged 3 commits intoveelenga:mainfrom
aodecipher:fix/propagate-mermaid-cli-errors

Conversation

@aodecipher
Copy link
Contributor

When mermaid-cli fails, execFileAsync throws with .stderr containing the actual parse error details (e.g., "Parse error on line 3..."), but only the generic error.message ("Command failed: npx ...") was surfaced to the MCP response. This made it difficult for Claude to self-correct Mermaid syntax errors.

Extract stderr from the caught error and include it in the thrown Error message so that detailed diagnostics reach the MCP client.

aodecipher and others added 3 commits March 8, 2026 20:35
When mermaid-cli fails, execFileAsync throws with `.stderr` containing
the actual parse error details (e.g., "Parse error on line 3..."), but
only the generic `error.message` ("Command failed: npx ...") was
surfaced to the MCP response. This made it impossible for Claude to
self-correct Mermaid syntax errors.

Extract stderr from the caught error and include it in the thrown Error
message so that detailed diagnostics reach the MCP client.
@veelenga veelenga merged commit 5bef9f4 into veelenga:main Mar 10, 2026
4 checks passed
@veelenga
Copy link
Owner

Thanks

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.

2 participants