8630ddfec4
> This is currently a WIP and all features are subject to alteration or removal at any time. ## Overview The successor to #2873. Contains the backbone of `beacon.watch` including syncing code, the initial API, and several core database tables. See `watch/README.md` for more information, requirements and usage.
57 lines
1.2 KiB
Rust
57 lines
1.2 KiB
Rust
use crate::blockprint::Error as BlockprintError;
|
|
use crate::database::Error as DbError;
|
|
use beacon_node::beacon_chain::BeaconChainError;
|
|
use eth2::{Error as Eth2Error, SensitiveError};
|
|
use std::fmt;
|
|
|
|
#[derive(Debug)]
|
|
pub enum Error {
|
|
BeaconChain(BeaconChainError),
|
|
Eth2(Eth2Error),
|
|
SensitiveUrl(SensitiveError),
|
|
Database(DbError),
|
|
Blockprint(BlockprintError),
|
|
UnableToGetRemoteHead,
|
|
BeaconNodeSyncing,
|
|
NotEnabled(String),
|
|
NoValidatorsFound,
|
|
BeaconNodeNotCompatible(String),
|
|
InvalidConfig(String),
|
|
}
|
|
|
|
impl fmt::Display for Error {
|
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
write!(f, "{:?}", self)
|
|
}
|
|
}
|
|
|
|
impl From<BeaconChainError> for Error {
|
|
fn from(e: BeaconChainError) -> Self {
|
|
Error::BeaconChain(e)
|
|
}
|
|
}
|
|
|
|
impl From<Eth2Error> for Error {
|
|
fn from(e: Eth2Error) -> Self {
|
|
Error::Eth2(e)
|
|
}
|
|
}
|
|
|
|
impl From<SensitiveError> for Error {
|
|
fn from(e: SensitiveError) -> Self {
|
|
Error::SensitiveUrl(e)
|
|
}
|
|
}
|
|
|
|
impl From<DbError> for Error {
|
|
fn from(e: DbError) -> Self {
|
|
Error::Database(e)
|
|
}
|
|
}
|
|
|
|
impl From<BlockprintError> for Error {
|
|
fn from(e: BlockprintError) -> Self {
|
|
Error::Blockprint(e)
|
|
}
|
|
}
|