Skip to content

Commit

Permalink
Log errors happening inside web3 transport.
Browse files Browse the repository at this point in the history
  • Loading branch information
artemii235 committed Jul 2, 2019
1 parent 226c730 commit 4a10a6c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mm2src/coins/eth/web3_transport.rs
Expand Up @@ -58,14 +58,17 @@ impl Transport for Web3Transport {
let mut futures = vec![];
for uri in self.uris.iter() {
let request = to_string(&request);
let mut req = http::Request::new(Vec::from(request));
let mut req = http::Request::new(Vec::from(request.clone()));
*req.method_mut() = http::Method::POST;
*req.uri_mut() = uri.clone();
req.headers_mut().insert(http::header::CONTENT_TYPE, HeaderValue::from_static("application/json"));
let fut = slurp_req(req)
.map_err(|e| StringError(e))
.timeout(Duration::from_secs(60))
.map_err(|e| ERRL!("{}", e.0));
.map_err(move |e| {
log!("Error " (e.0) " on request " (request));
ERRL!("{}", e.0)
});
futures.push(fut);
}

Expand Down

0 comments on commit 4a10a6c

Please sign in to comment.