Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances error reporting across the Algorand SDK by integrating the serde_path_to_error library. When deserialization fails, error messages now include the full path to the problematic field (e.g., block.txns[10].dt.gd.current_miner.bs), making debugging significantly easier compared to generic error messages.
Key Changes:
- Added
serde_path_to_errordependency to all client crates and core libraries - Replaced direct
serde_json::from_sliceandrmp_serde::from_slicecalls withserde_path_to_error::deserializethroughout the codebase - Updated code generation templates to emit the new deserialization pattern for future API changes
- Added new error variant
DecodingErrorWithPathinalgokit_transactto preserve path information
Reviewed changes
Copilot reviewed 102 out of 103 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
crates/algod_client/Cargo.toml |
Added serde_path_to_error dependency |
crates/algod_client/src/apis/*.rs (66 files) |
Updated JSON and MessagePack deserialization to use serde_path_to_error |
crates/kmd_client/Cargo.toml |
Added serde_path_to_error dependency |
crates/kmd_client/src/apis/*.rs (23 files) |
Updated JSON deserialization to use serde_path_to_error |
crates/indexer_client/Cargo.toml |
Added serde_path_to_error dependency |
crates/indexer_client/src/apis/*.rs (24 files) |
Updated JSON deserialization to use serde_path_to_error |
crates/algokit_transact/Cargo.toml |
Added serde_path_to_error dependency |
crates/algokit_transact/src/error.rs |
Added DecodingErrorWithPath error variant with path information |
crates/algokit_transact/src/transactions/mod.rs |
Updated MessagePack deserialization in SignedTransaction::decode |
crates/algokit_transact/src/traits.rs |
Updated AlgorandMsgpack::decode to use serde_path_to_error |
crates/algokit_abi/Cargo.toml |
Added serde_path_to_error dependency |
crates/algokit_abi/src/arc56_contract.rs |
Updated JSON deserialization in Arc56Contract::from_json |
api/oas_generator/rust_oas_generator/templates/base/Cargo.toml.j2 |
Updated template to include serde_path_to_error dependency |
api/oas_generator/rust_oas_generator/templates/apis/endpoint.rs.j2 |
Updated template for JSON/MessagePack deserialization |
api/oas_generator/rust_oas_generator/templates/apis/api.rs.j2 |
Updated template for JSON deserialization |
Cargo.lock |
Added serde_path_to_error version 0.1.17 with dependencies |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f12513c to
7d43c51
Compare
49fb5ab to
b8b8ce2
Compare
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.
Leverages path_to_error to get better serde error messages
Example from an algod serialization error:
Before:
After: