-
-
Notifications
You must be signed in to change notification settings - Fork 651
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
improve error handling in ui module #1870
Conversation
Hi @har7an , could you please review this pr? |
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.
Thanks for your continued help with the error handling!
I've left a few small remarks on your code. Overall this looks good and it helps us a lot.
.fatal() | ||
.cmp( | ||
&self | ||
.z_indices | ||
.iter() | ||
.position(|id| id == *b_id) | ||
.with_context(err_context) | ||
.fatal(), |
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.
Why are you using .fatal()
instead of ?
here?
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.
Because returning result is not allowed in a closure
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.
Ah, I missed the closure above, my bad!
And on a sidenote, it seems you beat me to the change in But that's okay, since your PR touches many more things I'll close mine and we'll go with yours instead. |
Thank you for your patient review, I learned a lot from your comments |
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.
Well done, thanks for your contribution! And thank you for being so open to my remarks.
Remove calls to `unwrap` in `zellij_server::ui::*`
Replacing unwrap in
ui
module with error propagation.Related to #1753