Skip to content
This repository was archived by the owner on May 24, 2025. It is now read-only.

Conversation

@cchudant
Copy link
Member

@cchudant cchudant commented Sep 5, 2024

Replace all error handling with anyhow

I am debugging the madara <=> madara bootstrapper integration and ran into some errors that looked like this

thread 'main' panicked at src/contract_clients/config.rs:29:10:
called `Result::unwrap()` on an `Err` value: UrlParser
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

which were hard to debug, so I moved the entire crate to anyhow.

Now it's more like this

Error: Initializing client config

Caused by:
    0: Creating the Ethereum RPC client
    1: Failed to parse URL

with each layers adding more context to the errors.

A lot of the error handling here, especially the add to json errors and wait for transaction stuff are very very redundant though - but i think this needs a deeper refactoring than the surface level stuff I just did here.

@cchudant
Copy link
Member Author

cchudant commented Sep 5, 2024

also the unwrap count is now 0 🥳

@Mohiiit Mohiiit changed the base branch from main to dev September 25, 2024 12:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant