-
Notifications
You must be signed in to change notification settings - Fork 405
[HandleError] rename msg field to action #53
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
[HandleError] rename msg field to action #53
Conversation
src/ln/msgs.rs
Outdated
@@ -380,7 +380,7 @@ pub enum ErrorAction { | |||
|
|||
pub struct HandleError { //TODO: rename me | |||
pub err: &'static str, | |||
pub msg: Option<ErrorAction>, //TODO: Make this required and rename it | |||
pub action: Option<ErrorAction>, //TODO: Make this required and rename it |
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.
Update the TODO maybe :)
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.
Looks good. Diff sucks, but I guess its best to get it over with earlier than later.
src/ln/msgs.rs
Outdated
@@ -380,7 +380,7 @@ pub enum ErrorAction { | |||
|
|||
pub struct HandleError { //TODO: rename me | |||
pub err: &'static str, | |||
pub msg: Option<ErrorAction>, //TODO: Make this required and rename it | |||
pub action: Option<ErrorAction>, //TODO: Make this required and rename it |
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.
Can remove the "rename it" TODO :)
Note that "making it required" would be s/Option<ErrorAction>/ErrorAction/, but that will require filling in each action, which means figuring out exactly how we want to handle everything. |
To remove the Option I think we need to fulfill incrementally all empty msg field of HandleError with actual errors or futures ones (like BanPeer or KeyError). I'll try to clean others TODO errors in |
this was a TODO and also briefly discussed in #43 (review) I'm not fully sure how to remove the `Option`, and make it completely required. Would love suggestions. So, have omitted that for now. Plus, better to make smaller, incremental changes. Test Plan: `cargo build` `cargo test`
|
Have a look on Chap2,3,6 : http://labs.kernelconcepts.de/downloads/books/Pro%20Git%20-%20Scott%20Chacon.pdf ;) Anyways don't hesitate to show up on IRC #rust-bitcoin, Freenode |
No, force-pushing to a feature branch is generally fine, its only really bad practice on a master branch (though I use my own personal fork's master branch as a feature branch, too, just don't force push to rust-bitcoin/rust-lightning). |
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.
eh, forgot to submit this comment
@@ -380,7 +380,7 @@ pub enum ErrorAction { | |||
|
|||
pub struct HandleError { //TODO: rename me |
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.
@TheBlueMatt off-topic to this diff, but since we're here: what's a better name for this? Would ErrorContext
be more suitable?
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.
Hmm, I think eventually we need to separate out our error types, making this more of a MessageHandleError or PeerHandleError or something like that, and use a different type where that doesn't make sense.
this was a TODO and also briefly discussed in #43 (review)
I'm not fully sure how to remove the
Option
, and make it completely required. Would love suggestions. So, have omitted that for now. Plus, better to make smaller, incremental changes.Test Plan:
cargo build
cargo test