aboutsummaryrefslogtreecommitdiff
path: root/src/error.rs
blob: 1e611adbbda988fd817c55dcb08a3e5391326e69 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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),

	#[error(display = "HTTP error")]
	HTTP(#[error(source)] http::Error),

	#[error(display = "Messagepack encode error")]
	RMPEncode(#[error(source)] rmp_serde::encode::Error),
	#[error(display = "Messagepack decode error")]
	RMPDecode(#[error(source)] rmp_serde::decode::Error),

	#[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),

	#[error(display = "")]
	Message(String),
}