node: exit on GRANDPA voter or BABE authoring error (#3353)

* node: exit on GRANDPA voter or BABE authoring error

* node: exit process with non-zero return code when service fails

* service: rename infallible task to essential task

* service: revert field name changes

* core: fix service testnet
This commit is contained in:
André Silva
2019-08-12 14:54:30 +01:00
committed by Robert Habermeier
parent 09b57261df
commit 70d716dc48
10 changed files with 98 additions and 41 deletions
+12 -1
View File
@@ -36,7 +36,17 @@ pub enum Error {
Input(String),
/// Invalid listen multiaddress
#[display(fmt="Invalid listen multiaddress")]
InvalidListenMultiaddress
InvalidListenMultiaddress,
/// Other uncategorized error.
Other(String),
}
/// Must be implemented explicitly because `derive_more` won't generate this
/// case due to conflicting derive for `Other(String)`.
impl std::convert::From<String> for Error {
fn from(s: String) -> Error {
Error::Input(s)
}
}
impl std::error::Error for Error {
@@ -48,6 +58,7 @@ impl std::error::Error for Error {
Error::Client(ref err) => Some(err),
Error::Input(_) => None,
Error::InvalidListenMultiaddress => None,
Error::Other(_) => None,
}
}
}