fix(respecDocWriter): show actual error instead of 'Error: undefined'#5179
fix(respecDocWriter): show actual error instead of 'Error: undefined'#5179marcoscaceres wants to merge 4 commits intomainfrom
Conversation
The timeout rejection in evaluateHTML rejects with a plain string, not an Error object. When caught, err.stack is undefined, producing the unhelpful message 'Error: undefined'. Now falls back to err itself when stack is unavailable. Closes #5080
There was a problem hiding this comment.
Pull request overview
Improves the fatal error message emitted by respecDocWriter during static HTML generation so that non-Error rejections (e.g., plain strings) show meaningful details instead of Error: undefined.
Changes:
- Update
generateHTML()error formatting to fall back to the caught value whenerr.stackis unavailable.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
@copilot, would it be possible/better to reject evaluateHTML with an actual error somehow? Then we would always have a stack. |
…k trace Agent-Logs-Url: https://github.com/speced/respec/sessions/f176c005-9bb3-483c-8784-2ca3e5ac0dff Co-authored-by: marcoscaceres <870154+marcoscaceres@users.noreply.github.com>
Fixed the root cause in b27310e — |
The timeout rejection in evaluateHTML rejects with a plain string, not an Error object. When caught, err.stack is undefined, producing 'Error: undefined'. Now falls back to err itself when stack is unavailable.
Closes #5080