2020-04-05 21:33:42 +00:00
|
|
|
use err_derive::Error;
|
|
|
|
use std::io;
|
|
|
|
|
|
|
|
#[derive(Debug, Error)]
|
|
|
|
pub enum Error {
|
2020-04-07 16:10:20 +00:00
|
|
|
#[error(display = "IO error: {}", _0)]
|
2020-04-05 21:33:42 +00:00
|
|
|
Io(#[error(source)] io::Error),
|
|
|
|
|
2020-04-07 16:10:20 +00:00
|
|
|
#[error(display = "Hyper error: {}", _0)]
|
2020-04-05 21:33:42 +00:00
|
|
|
Hyper(#[error(source)] hyper::Error),
|
|
|
|
|
2020-04-07 16:10:20 +00:00
|
|
|
#[error(display = "HTTP error: {}", _0)]
|
2020-04-06 17:55:39 +00:00
|
|
|
HTTP(#[error(source)] http::Error),
|
|
|
|
|
2020-04-07 22:39:07 +00:00
|
|
|
#[error(display = "Invalid HTTP header value: {}", _0)]
|
|
|
|
HTTPHeader(#[error(source)] http::header::ToStrError),
|
|
|
|
|
2020-04-08 21:01:49 +00:00
|
|
|
#[error(display = "Sled error: {}", _0)]
|
|
|
|
Sled(#[error(source)] sled::Error),
|
|
|
|
|
2020-04-07 16:10:20 +00:00
|
|
|
#[error(display = "Messagepack encode error: {}", _0)]
|
2020-04-05 21:33:42 +00:00
|
|
|
RMPEncode(#[error(source)] rmp_serde::encode::Error),
|
2020-04-07 16:10:20 +00:00
|
|
|
#[error(display = "Messagepack decode error: {}", _0)]
|
2020-04-05 21:33:42 +00:00
|
|
|
RMPDecode(#[error(source)] rmp_serde::decode::Error),
|
|
|
|
|
2020-04-07 16:10:20 +00:00
|
|
|
#[error(display = "TOML decode error: {}", _0)]
|
2020-04-06 17:55:39 +00:00
|
|
|
TomlDecode(#[error(source)] toml::de::Error),
|
|
|
|
|
2020-04-07 16:10:20 +00:00
|
|
|
#[error(display = "Timeout: {}", _0)]
|
2020-04-06 17:55:39 +00:00
|
|
|
RPCTimeout(#[error(source)] tokio::time::Elapsed),
|
|
|
|
|
2020-04-07 16:10:20 +00:00
|
|
|
#[error(display = "RPC error: {}", _0)]
|
2020-04-06 17:55:39 +00:00
|
|
|
RPCError(String),
|
|
|
|
|
2020-04-07 22:39:07 +00:00
|
|
|
#[error(display = "{}", _0)]
|
|
|
|
BadRequest(String),
|
|
|
|
|
2020-04-07 16:10:20 +00:00
|
|
|
#[error(display = "{}", _0)]
|
2020-04-06 17:55:39 +00:00
|
|
|
Message(String),
|
2020-04-05 21:33:42 +00:00
|
|
|
}
|