Skip to content

Conversation

joe-p
Copy link
Collaborator

@joe-p joe-p commented Aug 18, 2025

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

@Copilot Copilot AI review requested due to automatic review settings August 18, 2025 15:19
Copy link
Contributor

@Copilot Copilot AI left a 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 to snafu::Snafu with appropriate display attributes
  • Converts error variant patterns from Error(inner) to Error { 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.

Copy link
Collaborator

@PatrickDinh PatrickDinh left a comment

Choose a reason for hiding this comment

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

LGTM

@joe-p joe-p merged commit 1f1a6c5 into main Aug 20, 2025
19 checks passed
@joe-p joe-p deleted the feat/snafu branch August 20, 2025 12:46
@engineering-ci
Copy link
Contributor

🎉 This PR is included in version 1.0.0-alpha.50 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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