Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
Stop ignoring publish errors
Browse files Browse the repository at this point in the history
Resolves #48.
  • Loading branch information
David Cao committed Apr 10, 2019
1 parent f882f3f commit 3ed3ad7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/lib/remote/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl Registry {

pub fn publish(&self, tar: File, name: &Name, version: &Version, token: &str) -> Res<()> {
let client = Client::builder().timeout(Duration::from_secs(10)).build()?;
client
let mut resp = client
.put(
self.url
.join(&format!(
Expand All @@ -126,7 +126,11 @@ impl Registry {
.body(tar)
.send()?;

Ok(())
if resp.status().is_success() {
Ok(())
} else {
Err(format_err!("{}", resp.text()?))?
}
}

pub fn search(&self, indices: &Indices, query: &str) -> Res<SearchResponse<SearchVersioned>> {
Expand Down

0 comments on commit 3ed3ad7

Please sign in to comment.