Skip to content

Conversation

@mbjorkqvist
Copy link
Contributor

Use a StorageError enum for storage operation errors. The wrapper around anyhow::Error in this commit in the parent PR seems to be an improvement on the initial implementation, but it has a code smell - anyhow::Error intentionally doesn't implement std::error::Error. This PR proposes to use a StorageError enumeration with explicit variants for database errors (rusqlite::Error) and a couple of other types. For more complex internal errors, an Internal variant is used to wrap existing anyhow::Errors - these currently mainly come from update_account_balances. Ideally, we wouldn't have the Internal variant wrapping anyhow::Error either - we could work on removing that in subsequent commits in this PR.

@mbjorkqvist mbjorkqvist changed the base branch from master to mathias/DEFI-2452-icrc-rosetta-tokio-rusqlite January 6, 2026 14:09
mbjorkqvist and others added 2 commits January 6, 2026 15:13
…hias/DEFI-2452-icrc-rosetta-tokio-rusqlite-storageerror-enum

# Conflicts:
#	rs/rosetta-api/icrc1/src/common/storage/storage_client.rs
Base automatically changed from mathias/DEFI-2452-icrc-rosetta-tokio-rusqlite to master January 9, 2026 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant