Add `MessageTypeUnhandled` error
This change adds a variant to the `AdminError` to use when a message
type is unhandled, `MessageTypeUnhandled`.
@@ -294,6 +294,8 @@ impl std::fmt::Display for AdminConsensusManagerError {
pub enum AdminError {
ConsensusFailed(AdminConsensusManagerError),
MessageTypeUnset,
+ #[cfg(not(feature = "proposal-removal"))]
+ MessageTypeUnhandled,
}
impl Error for AdminError {
@@ -301,6 +303,8 @@ impl Error for AdminError {
match self {
AdminError::ConsensusFailed(err) => Some(err),
AdminError::MessageTypeUnset => None,
+ #[cfg(not(feature = "proposal-removal"))]
+ AdminError::MessageTypeUnhandled => None,
}
}
}
@@ -310,6 +314,8 @@ impl std::fmt::Display for AdminError {
match self {
AdminError::ConsensusFailed(err) => write!(f, "admin consensus failed: {}", err),
AdminError::MessageTypeUnset => write!(f, "received message with unset type"),
+ #[cfg(not(feature = "proposal-removal"))]
+ AdminError::MessageTypeUnhandled => write!(f, "received message with unhandled type"),
}
}
}
