From c3b846a0d2de982a04b777b803ea0614e97ef085 Mon Sep 17 00:00:00 2001 From: Alex Hamilton Date: Sat, 22 Dec 2018 17:47:18 -0600 Subject: [PATCH] Convert error statuses into reqwest Err variants. --- src/http/client/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/http/client/mod.rs b/src/http/client/mod.rs index 8eaa4b8..71f188f 100644 --- a/src/http/client/mod.rs +++ b/src/http/client/mod.rs @@ -24,7 +24,7 @@ pub trait AsRequest { } /// The result type for all requests made with the client. -pub type ClientResult = ::std::result::Result; +pub type ClientResult = Result; /// The crux of the HTTP API. Start here. /// @@ -127,7 +127,8 @@ where .request(method, url) .bearer_auth(token) .json(&self.body) - .send() + .send()? + .error_for_status() } }