blob: 07bb578022d67c1899d1ae5864368e5d53b54270 (
plain)
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
32
|
use reqwest::Error as ReqwestError;
use std::convert::From;
#[derive(Debug)]
enum Kind {
Reqwest(ReqwestError),
ClientError(String),
}
#[derive(Debug)]
pub struct Error {
inner: Kind
}
impl From<reqwest::Error> for Error {
fn from(err: ReqwestError) -> Error {
Error {
inner: Kind::Reqwest(err)
}
}
}
impl From<futures::Canceled> for Error {
fn from(_err: futures::Canceled) -> Error {
Error {
inner: Kind::ClientError("Oneshot channel unexpectedly closed".to_owned())
}
}
}
|