Skip to content

Commit

Permalink
Convert error statuses into reqwest Err variants.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aehmlo committed Dec 22, 2018
1 parent df60a5e commit c3b846a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/http/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub trait AsRequest<S: Serialize> {
}

/// The result type for all requests made with the client.
pub type ClientResult = ::std::result::Result<reqwest::Response, reqwest::Error>;
pub type ClientResult = Result<reqwest::Response, reqwest::Error>;

/// The crux of the HTTP API. Start here.
///
Expand Down Expand Up @@ -127,7 +127,8 @@ where
.request(method, url)
.bearer_auth(token)
.json(&self.body)
.send()
.send()?
.error_for_status()
}
}

Expand Down

0 comments on commit c3b846a

Please sign in to comment.