-
Notifications
You must be signed in to change notification settings - Fork 166
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
refactor(katana): improve error handling #1415
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev/katana #1415 +/- ##
=============================================
Coverage ? 67.95%
=============================================
Files ? 220
Lines ? 21403
Branches ? 0
=============================================
Hits ? 14544
Misses ? 6859
Partials ? 0 ☔ View full report in Codecov by Sentry. |
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.
Minor comment that may be addressed in subsequent iterations.
@@ -95,7 +95,7 @@ impl Backend { | |||
); | |||
|
|||
let blockchain = Blockchain::new_from_forked( | |||
ForkedProvider::new(provider, forked_block_num.into()), | |||
ForkedProvider::new(provider, forked_block_num.into()).unwrap(), |
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.
Would just add expect("ForkedProvider backend thread couldn't be started")
or perhaps in next PRs with checking which unwrap
are controlled and which are not?
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.
Good idea. I could put that in, but I want to refactor the caller function to also propagate the error.
Would do that in the next PR.
This PR adds initial error handling improvement. The idea is to not rely on
anyhow
on lib level andkatana-providers
replacinganyhow
.SequencerError
enum.UnexpectedError
variant ofStarknetApiError
into a struct with areason
field.