fix(cli): catch output directory creation errors in render#130
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
1704c30 to
898d7c4
Compare
miguel-heygen
left a comment
There was a problem hiding this comment.
errorBox parameter semantics are swapped
The errorBox signature is errorBox(title, hint?, suggestion?) where hint is rendered dimmed (informational) and suggestion is rendered accented (actionable command). Every other call site in this file follows that convention.
The current call passes the directory path as hint and the raw OS error as suggestion, which means the error message (e.g. "EACCES: permission denied") gets styled as if it were an actionable command.
Suggest:
errorBox(
"Cannot create output directory",
`${dirname(outputPath)}: ${message}`,
"Check that you have write permission or specify a different path with --output.",
);Also minor: `${dirname(outputPath)}` is equivalent to just dirname(outputPath) since it already returns a string — the template literal wrapping is unnecessary.
mkdirSync for the render output path was not wrapped in try-catch, exposing a raw Node.js EACCES stack trace when the path was invalid or permissions were denied. Reproducer: npx hyperframes render --output /root/nope/output.mp4 # Was: raw "Error: EACCES: permission denied" with stack trace # Now: clean "Cannot create output directory" error box
d4af810 to
9c93dff
Compare
898d7c4 to
5430f9a
Compare
miguel-heygen
left a comment
There was a problem hiding this comment.
Addressed: fixed errorBox parameter order — error message now in hint slot, actionable suggestion ("Check write permission or use --output") in suggestion slot. Removed unnecessary template literal.
|
Consolidated into fix/render-improvements. |

Summary
mkdirSyncfor the render output path was not wrapped in try-catcherrorBoxhelperReproducer
Stack
7/8 in the HyperFrames new-user bug fixes stack.
🤖 Generated with Claude Code