+ CheckAlive,
+}
+
+impl fmt::Display for CheckError {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ match self {
+ CheckError::HttpError(text) => {
+ write!(
+ f,
+ "Beacon node health check can't be reached (HTTP error): {}",
+ text
+ )
+ }
+ CheckError::NotSync => {
+ write!(
+ f,
+ "Beacon node health check is syncing (currently not sync)"
+ )
+ }
+ CheckError::InvalidSyncStatus => {
+ write!(f, "Beacon node health check returns an invalid status code")
+ }
+ CheckError::NodeHavingIssues => {
+ write!(
+ f,
+ "Beacon node health check is not initilized or having issue"
+ )
+ }
+ CheckError::UnknownCodeFromHealthCheck(code) => {
+ write!(
+ f,
+ "Beacon node health check returns an unknown code: {}",
+ code
+ )
+ }
+ CheckError::ReqwestError(error) => {
+ write!(f, "Error from reqwest: {}", error)
+ }
+ CheckError::ValidatorError { pub_key, message } => {
+ write!(f, "Validator '{}' returns an error: {}", pub_key, message)
+ }
+ CheckError::ValidatorStatusError { pub_key, message } => {
+ write!(
+ f,
+ "Validator '{}' returns a status error: {}",
+ pub_key, message
+ )
+ }
+ CheckError::CheckAlive => {
+ write!(f, "Check alive ping hasn't been received")
+ }
+ }
+ }