message: [config] Improve Parse Error
  Use a specific error type for parsing errors.
  Closes:
  Approved by: bmwill
diff: @@ -125,13 +125,13 @@ impl RoleType {
  }
  impl std::str::FromStr for RoleType {
  - type Err = failure::Error;
  + type Err = ParseRoleError;
  - fn from_str(s: &str) -> Result<Self> {
  + fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
  match s {
  "validator" => Ok(RoleType::Validator),
  "full_node" => Ok(RoleType::FullNode),
  - _ => bail!("Invalid node role: {}", s),
  + _ => Err(ParseRoleError(s.to_string())),
  }
  }
  }
  @@ -145,6 +145,15 @@ impl fmt::Display for RoleType {
  }
  }
  +#[derive(Debug)]
  +pub struct ParseRoleError(String);
  +
  +impl fmt::Display for ParseRoleError {
  + fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
  + write!(fmt, "Invalid node role: {}", &self.0)
  + }
  +}
  +
  impl NodeConfig {
  /// This clones the underlying data except for the keypair so that this config can be used as a
  /// template for another config.
  