Skip to content

Conversation

@drondeseries
Copy link
Owner

When a download pipe is closed due to an error (e.g., article not found), the reader now reliably receives the specific error instead of losing it.

Changes:

  • Add explicit downloadErr field to segment struct for error storage
  • Add SetDownloadError/GetDownloadError methods with first-write-wins semantics
  • Create errorAwareReader wrapper to check stored errors before/after reads
  • Update GetReader() to capture errors from skip logic (previously discarded)
  • Update safeWriter.CloseWithError() to store error before closing pipes
  • Add comprehensive tests for error propagation scenarios

This ensures that errors like "article not found" are properly propagated to the reader and wrapped in DataCorruptionError for proper handling.

🤖 Generated with Claude Code

When a download pipe is closed due to an error (e.g., article not found),
the reader now reliably receives the specific error instead of losing it.

Changes:
- Add explicit downloadErr field to segment struct for error storage
- Add SetDownloadError/GetDownloadError methods with first-write-wins semantics
- Create errorAwareReader wrapper to check stored errors before/after reads
- Update GetReader() to capture errors from skip logic (previously discarded)
- Update safeWriter.CloseWithError() to store error before closing pipes
- Add comprehensive tests for error propagation scenarios

This ensures that errors like "article not found" are properly propagated
to the reader and wrapped in DataCorruptionError for proper handling.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.5 <[email protected]>
@drondeseries drondeseries merged commit 581d66c into drondeseries:main Dec 29, 2025
1 check 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.

2 participants