-
Notifications
You must be signed in to change notification settings - Fork 7
feat: migrate from thiserror to snafu #234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR migrates error handling from the thiserror
crate to the snafu
crate across the entire Algorand Rust SDK codebase. The migration requires changing error enum variants from simple variants to struct-like variants, as snafu expects named fields for error data.
- Updates all error enums from
thiserror::Error
tosnafu::Snafu
with appropriate display attributes - Converts error variant patterns from
Error(inner)
toError { field: inner }
format - Updates error construction and matching throughout the codebase to use the new struct-like syntax
Reviewed Changes
Copilot reviewed 127 out of 128 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
scripts/sanity.sh | Adds API generation commands to the sanity check script |
Multiple indexer/algod client files | Updates error handling from thiserror to snafu pattern |
crates/*/Cargo.toml | Replaces thiserror dependency with snafu in workspace crates |
Test files | Updates error pattern matching to use new struct-like syntax |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
🎉 This PR is included in version 1.0.0-alpha.50 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Migrates all the errors from thiserror to snafu. The main difference is that snafu needs enum variants to be a struct so that's what most of this diff is. This was mostly work done by GPT-5, but I don't think we need to go over it with a fine-toothed comb since we have another story for unifying error handling and any problems can be caught then. For now though, every test is passing.
This PR won't be merged until the following PRs are merged. Merge conflicts are anticipated and will be resolved in this branch.
Future PRs should use this branch has a base until it is merged