error: imple Error for EthFailed

This commit is contained in:
ghassmo
2021-10-27 11:50:57 +03:00
parent 8b48849c77
commit c30681a35b

View File

@@ -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<crate::service::SolFailed> for Error {
}
}
#[cfg(feature = "eth")]
impl From<crate::service::EthFailed> for Error {
fn from(err: crate::service::EthFailed) -> Error {
Error::EthFailed(err.to_string())
}
}
impl From<toml::de::Error> for Error {
fn from(err: toml::de::Error) -> Error {
Error::TomlDeserializeError(err.to_string())