Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #1258 #1312

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/cargo/sources/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,10 +524,19 @@ impl<'a, 'b> Source for RegistrySource<'a, 'b> {
url.path_mut().unwrap().push(package.name().to_string());
url.path_mut().unwrap().push(package.version().to_string());
url.path_mut().unwrap().push("download".to_string());
let path = try!(self.download_package(package, &url).chain_error(|| {
let mut path = self.download_package(package, &url).chain_error(|| {
internal(format!("Failed to download package `{}` from {}",
package, url))
}));
});
for _ in 0 .. 3 {
if path.is_ok() { break }
try!(self.config.shell().status("Refetching", package));
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe try!(self.config.shell().error(format!("Refetching {}", package))); is a better idea.
I'm not sure if this should be considered an error or normal status, @wycats .

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe try!(self.config.shell().warn(format!("Refetching {}", package)));

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I think we could use Downloading(1), Downloading(2), etc, to represent retrying.

path = self.download_package(package, &url).chain_error(|| {
internal(format!("Failed to download package `{}` from {}",
package, url))
});
}
let path = try!(path);
let path = try!(self.unpack_package(package, path).chain_error(|| {
internal(format!("Failed to unpack package `{}`", package))
}));
Expand Down