Skip to content

fix(seed): report create_dir_all failure instead of panicking - #724

Merged
dubadub merged 1 commit into
cooklang:mainfrom
drawmeanelephant:fix/706-seed-create-dir-panic
Oct 15, 2026
Merged

dubadub merged 1 commit into
cooklang:mainfrom
drawmeanelephant:fix/706-seed-create-dir-panic

Conversation

@drawmeanelephant

Copy link
Copy Markdown
Contributor

Closes #706

cook seed /dev/null/sub panicked with exit 101 because fs::create_dir_all was unwrapped with expect. Now propagates with context, matching every other command's Error: ... behaviour.

Test plan

  • cook seed /dev/null/sub prints Error: Couldn't create output path: /dev/null/sub and exits 1

`cook seed` unwrapped the `create_dir_all` result with `expect`, so an
output path that cannot be created — `/dev/null/sub`, a permission
problem — panicked with exit 101 while every other command reports a
clean `Error:`. Propagate it with context instead.

Closes #706

@LeMyst LeMyst left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me: .with_context(...)? instead of .expect fixes the repro from #706. Merges cleanly with #725.


🤖 Analysis and recommendations made by Claude (Anthropic's AI assistant), posted on behalf of @LeMyst.

@dubadub
dubadub merged commit 32bac24 into cooklang:main Oct 15, 2026
6 checks passed
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.

cook seed panics when the output directory cannot be created

3 participants