2020-04-05 21:33:42 +00:00
|
|
|
use err_derive::Error;
|
|
|
|
use std::io;
|
|
|
|
|
|
|
|
#[derive(Debug, Error)]
|
|
|
|
pub enum Error {
|
|
|
|
#[error(display = "IO error")]
|
|
|
|
Io(#[error(source)] io::Error),
|
|
|
|
|
|
|
|
#[error(display = "Hyper error")]
|
|
|
|
Hyper(#[error(source)] hyper::Error),
|
|
|
|
|
2020-04-06 17:55:39 +00:00
|
|
|
#[error(display = "HTTP error")]
|
|
|
|
HTTP(#[error(source)] http::Error),
|
|
|
|
|
2020-04-05 21:33:42 +00:00
|
|
|
#[error(display = "Messagepack encode error")]
|
|
|
|
RMPEncode(#[error(source)] rmp_serde::encode::Error),
|
|
|
|
#[error(display = "Messagepack decode error")]
|
|
|
|
RMPDecode(#[error(source)] rmp_serde::decode::Error),
|
|
|
|
|
2020-04-06 17:55:39 +00:00
|
|
|
#[error(display = "TOML decode error")]
|
|
|
|
TomlDecode(#[error(source)] toml::de::Error),
|
|
|
|
|
|
|
|
#[error(display = "Timeout")]
|
|
|
|
RPCTimeout(#[error(source)] tokio::time::Elapsed),
|
|
|
|
|
|
|
|
#[error(display = "RPC error")]
|
|
|
|
RPCError(String),
|
|
|
|
|
2020-04-05 21:33:42 +00:00
|
|
|
#[error(display = "")]
|
2020-04-06 17:55:39 +00:00
|
|
|
Message(String),
|
2020-04-05 21:33:42 +00:00
|
|
|
}
|