From c30681a35bec004fa3733987e5785dec0179d0e4 Mon Sep 17 00:00:00 2001 From: ghassmo Date: Wed, 27 Oct 2021 11:50:57 +0300 Subject: [PATCH] error: imple Error for EthFailed --- src/error.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/error.rs b/src/error.rs index 7600d2518..4f172e302 100644 --- a/src/error.rs +++ b/src/error.rs @@ -55,6 +55,8 @@ pub enum Error { BtcFailed(String), #[cfg(feature = "sol")] SolFailed(String), + #[cfg(feature = "eth")] + EthFailed(String), BridgeError(String), ZmqError(String), @@ -133,6 +135,8 @@ impl fmt::Display for Error { Error::BtcFailed(ref err) => write!(f, "Btc client failed: {}", err), #[cfg(feature = "sol")] Error::SolFailed(ref err) => write!(f, "Sol client failed: {}", err), + #[cfg(feature = "eth")] + Error::EthFailed(ref err) => write!(f, "Eth client failed: {}", err), Error::TryIntoError => f.write_str("TryInto error"), Error::TryFromError => f.write_str("TryFrom error"), Error::TryFromBigIntError => f.write_str("TryFromBigInt error"), @@ -299,6 +303,13 @@ impl From for Error { } } +#[cfg(feature = "eth")] +impl From for Error { + fn from(err: crate::service::EthFailed) -> Error { + Error::EthFailed(err.to_string()) + } +} + impl From for Error { fn from(err: toml::de::Error) -> Error { Error::TomlDeserializeError(err.to_string())