add SolFailed error to error.rs

This commit is contained in:
ghassmo
2021-09-12 01:41:46 +03:00
parent 03ebecbbb9
commit be4746324b

View File

@@ -44,6 +44,8 @@ pub enum Error {
ClientFailed(String),
#[cfg(feature = "default")]
BtcFailed(String),
#[cfg(feature = "sol")]
SolFailed(String),
TryIntoError,
TryFromError,
JsonRpcError(String),
@@ -97,6 +99,8 @@ impl fmt::Display for Error {
Error::ClientFailed(ref err) => write!(f, "Client failed: {}", err),
#[cfg(feature = "default")]
Error::BtcFailed(ref err) => write!(f, "Btc client failed: {}", err),
#[cfg(feature = "sol")]
Error::SolFailed(ref err) => write!(f, "Sol client failed: {}", err),
Error::TryIntoError => f.write_str("TryInto error"),
Error::TryFromError => f.write_str("TryFrom error"),
Error::RocksdbError(ref err) => write!(f, "Rocksdb Error: {}", err),
@@ -226,6 +230,13 @@ impl From<crate::service::BtcFailed> for Error {
}
}
#[cfg(feature = "sol")]
impl From<crate::service::SolFailed> for Error {
fn from(err: crate::service::SolFailed) -> Error {
Error::SolFailed(err.to_string())
}
}
impl From<surf::Error> for Error {
fn from(err: surf::Error) -> Error {
Error::SurfHttpError(err.to_string())