-
Notifications
You must be signed in to change notification settings - Fork 342
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
fix(code quality): Remove panics from functions that return result #1013
fix(code quality): Remove panics from functions that return result #1013
Conversation
batcher/aligned-batcher/src/main.rs
Outdated
@@ -46,7 +46,7 @@ async fn main() -> Result<(), BatcherError> { | |||
// spawn task to listening for incoming blocks | |||
tokio::spawn({ | |||
let app = batcher.clone(); | |||
async move { app.listen_new_blocks().await.unwrap() } | |||
async move { app.listen_new_blocks().await } |
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.
This seems to ignore the errors, is that correct?
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.
This change seems strange, the unwrap should stay, app can't recover from this
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.
We can change it to an expect to make it more clear that we cannot recover from this
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.
expect()
added
"Failed to create wallet from anvil private key: {}", | ||
e.to_string() | ||
); | ||
return Ok(()); |
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.
Should the error be forwarded?
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.
This is already the return of the main function. Not much to do, but we could create an issue to return an Error everywhere so the application ends with an Error
closes #951
Removes possible panics in
aligned_batcher
andaligned::main
.