switch to managers: wip

This commit is contained in:
Aiden McClelland
2021-07-13 16:55:05 -06:00
committed by Aiden McClelland
parent e2b77b23f8
commit 34e4c12af3
26 changed files with 783 additions and 803 deletions

View File

@@ -46,6 +46,7 @@ pub enum ErrorKind {
InvalidRequest = 38,
MigrationFailed = 39,
Uninitialized = 40,
ParseNetAddress = 41,
}
impl ErrorKind {
pub fn as_str(&self) -> &'static str {
@@ -91,6 +92,7 @@ impl ErrorKind {
InvalidRequest => "Invalid Request",
MigrationFailed => "Migration Failed",
Uninitialized => "Uninitialized",
ParseNetAddress => "Net Address Parsing Error",
}
}
}
@@ -180,6 +182,11 @@ impl From<torut::control::ConnError> for Error {
Error::new(anyhow!("{:?}", e), ErrorKind::Tor)
}
}
impl From<std::net::AddrParseError> for Error {
fn from(e: std::net::AddrParseError) -> Self {
Error::new(e, ErrorKind::ParseNetAddress)
}
}
impl From<Error> for RpcError {
fn from(e: Error) -> Self {
let mut data_object = serde_json::Map::with_capacity(2);