mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-09 06:38:12 -05:00
add SolFailed error to error.rs
This commit is contained in:
11
src/error.rs
11
src/error.rs
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user