Skip to content

Commit

Permalink
Merge pull request #6890 from habitat-sh/retry_err
Browse files Browse the repository at this point in the history
report last error after all failed pkg download attempts
  • Loading branch information
mwrock committed Aug 22, 2019
2 parents 00b85bb + 5b25d6b commit 731c8c8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
14 changes: 14 additions & 0 deletions .expeditor/scripts/shared.ps1
@@ -1,3 +1,17 @@
function Get-RustfmtToolchain {
# It turns out that every nightly version of rustfmt has slight tweaks from the previous version.
# This means that if we're always using the latest version, then we're going to have enormous
# churn. Even PRs that don't touch rust code will likely fail CI, since master will have been
# formatted with a different version than is running in CI. Because of this, we're going to pin
# the version of nightly that's used to run rustfmt and bump it when we do a new release.
#
# Note that not every nightly version of rust includes rustfmt. Sometimes changes are made that
# break the way rustfmt uses rustc. Therefore, before updating the pin below, double check
# that the nightly version you're going to update it to includes rustfmt. You can do that
# using https://mexus.github.io/rustup-components-history/x86_64-unknown-linux-gnu.html
Get-Content "$PSScriptRoot\..\..\RUSTFMT_VERSION"
}

function Install-Habitat {
if (get-command -Name hab -ErrorAction SilentlyContinue) {
Write-Host "Using habitat version:`n$(hab --version)"
Expand Down
7 changes: 4 additions & 3 deletions components/common/src/command/package/install.rs
Expand Up @@ -672,11 +672,12 @@ impl<'a> InstallTask<'a> {
ident);
} else if self.is_offline() {
return Err(Error::OfflineArtifactNotFound(ident.as_ref().clone()));
} else if retry(delay::Fixed::from(RETRY_WAIT).take(RETRIES), fetch_artifact).is_err() {
} else if let Err(err) = retry(delay::Fixed::from(RETRY_WAIT).take(RETRIES), fetch_artifact)
{
return Err(Error::DownloadFailed(format!("We tried {} times but \
could not download {}. \
Giving up.",
RETRIES, ident)));
Last error was: {}",
RETRIES, ident, err)));
}

let mut artifact = PackageArchive::new(self.cached_artifact_path(ident));
Expand Down

0 comments on commit 731c8c8

Please sign in to comment.