|
@@ -46,6 +46,7 @@ pub enum Error {
|
|
|
RocksdbError(String),
|
|
RocksdbError(String),
|
|
|
TreeFull,
|
|
TreeFull,
|
|
|
SerdeJsonError(String),
|
|
SerdeJsonError(String),
|
|
|
|
|
+ SurfHttpError(String),
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
impl std::error::Error for Error {}
|
|
impl std::error::Error for Error {}
|
|
@@ -88,6 +89,7 @@ impl fmt::Display for Error {
|
|
|
Error::JsonRpcError(ref err) => write!(f, "JsonRpc Error: {}", err),
|
|
Error::JsonRpcError(ref err) => write!(f, "JsonRpc Error: {}", err),
|
|
|
Error::TreeFull => f.write_str("MerkleTree is full"),
|
|
Error::TreeFull => f.write_str("MerkleTree is full"),
|
|
|
Error::SerdeJsonError(ref err) => write!(f, "Json serialization error: {}", err),
|
|
Error::SerdeJsonError(ref err) => write!(f, "Json serialization error: {}", err),
|
|
|
|
|
+ Error::SurfHttpError(ref err) => write!(f, "Surf Http error: {}", err),
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -182,3 +184,9 @@ impl From<state::VerifyFailed> for Error {
|
|
|
Error::VerifyFailed
|
|
Error::VerifyFailed
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+impl From<surf::Error> for Error {
|
|
|
|
|
+ fn from(err: surf::Error) -> Error {
|
|
|
|
|
+ Error::SurfHttpError(err.to_string())
|
|
|
|
|
+ }
|
|
|
|
|
+}
|