Transition to ureq http client (#5777)

* Transition to ureq http client

* Remove unwrap
This commit is contained in:
Tyera Eulberg
2019-09-04 12:11:44 -07:00
committed by GitHub
parent 355640b5db
commit b19d9a50d3
16 changed files with 236 additions and 324 deletions

View File

@@ -5,10 +5,10 @@ use std::{fmt, io};
#[derive(Debug)]
pub enum ClientError {
Io(io::Error),
Reqwest(reqwest::Error),
RpcError(rpc_request::RpcError),
SerdeJson(serde_json::error::Error),
TransactionError(TransactionError),
Ureq(String),
}
impl fmt::Display for ClientError {
@@ -25,9 +25,9 @@ impl From<io::Error> for ClientError {
}
}
impl From<reqwest::Error> for ClientError {
fn from(err: reqwest::Error) -> ClientError {
ClientError::Reqwest(err)
impl From<&ureq::Error> for ClientError {
fn from(err: &ureq::Error) -> ClientError {
ClientError::Ureq(err.to_string())
}
}