Skip to content

fix(cli): improve --etag-save error path handling (test 369)#132

Merged
jonwiggins merged 1 commit intomainfrom
optio/task-2d555514-548e-4f56-96e9-01729bef4b8e
Mar 28, 2026
Merged

fix(cli): improve --etag-save error path handling (test 369)#132
jonwiggins merged 1 commit intomainfrom
optio/task-2d555514-548e-4f56-96e9-01729bef4b8e

Conversation

@jonwiggins
Copy link
Copy Markdown
Owner

Summary

  • Improves --etag-save error path handling to match curl's behavior by actually trying to open the file upfront (like curl's fopen("ab") in etag_store) instead of only checking parent directory existence
  • Catches permission errors and other failure modes beyond missing parent directories
  • Adds proper warning/error messages for the single-URL case, matching curl's output format

Closes #112

Test plan

  • Test 369 (--etag-save with bad path then working transfer) passes
  • Test 370 (--etag-save with bad path - no transfer) passes
  • All etag-related tests (338, 347, 369, 370, 481-485) pass
  • cargo clippy clean
  • cargo fmt clean
  • cargo test -p urlx-cli — 345 tests pass

🤖 Generated with Claude Code

… 369)

Instead of only checking parent directory existence, try to actually open
the etag file upfront (matching curl's fopen("ab") in etag_store). This
catches permission errors and other failure modes beyond missing parent
directories. Also adds proper warning/error messages for the single-URL
case matching curl's output format.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jonwiggins jonwiggins merged commit 2dccb80 into main Mar 28, 2026
7 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.

fix(cli): --etag-save error path handling

1 participant