Integrate thiserror and anyhow for structured error handling#5
Closed
Integrate thiserror and anyhow for structured error handling#5
Conversation
Co-authored-by: anuradhawick <9621844+anuradhawick@users.noreply.github.com>
Co-authored-by: anuradhawick <9621844+anuradhawick@users.noreply.github.com>
Co-authored-by: anuradhawick <9621844+anuradhawick@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Integrate thiserror and anyhow for consistent error handling
Integrate thiserror and anyhow for structured error handling
Nov 5, 2025
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5 +/- ##
==========================================
- Coverage 94.44% 94.19% -0.25%
==========================================
Files 13 13
Lines 918 913 -5
==========================================
- Hits 867 860 -7
- Misses 51 53 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces ad-hoc string-based error handling with typed errors using
thiserrorfor library code andanyhowfor CLI context.Changes
Core Error Types (
ktio::error)Defined 5 error variants covering the entire error surface:
std::io::Error)Library Updates
seq.rs,mmap.rsreturnktio::Result<T>cgr.rs,oligo.rs,oligocgr.rsuse typed errorsktio::ResultCLI Integration
CLI functions now return
anyhow::Resultwith context chains:Error output includes context and cause chains:
Documentation
Added
ERROR_HANDLING.mdwith usage patterns and migration guide.All 45 tests pass. No behavioral changes to existing functionality.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.