-
Notifications
You must be signed in to change notification settings - Fork 7
feat: use serde_path_to_error #319
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
base: main
Are you sure you want to change the base?
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 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
Leverages path_to_error to get better serde error messages
Example from an algod serialization error:
Before:
After: