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

raise error when dependecy download returns http error status code #477

Merged

Conversation

phil9909
Copy link
Member

Summary

When a HTTP server returns an unsuccessful HTTP status (e.g. 503 or 404) cargo would currently ignore this.
Most likely the sha verification would fail afterwards, but I guess it's better to catch the actual error.

Use Cases

More accurate errors

Checklist

  • I have viewed, signed, and submitted the Contributor License Agreement.
  • I have linked issue(s) that this PR should close using keywords or the Github UI (See docs)
  • I have added an integration test, if necessary.
  • I have reviewed the styleguide for guidance on my code quality.
  • I'm happy with the commit history on this PR (I have rebased/squashed as needed).

Co-authored-by: Marcel Hierling <marcel.hierling@sap.com>
Copy link
Member

@robdimsdale robdimsdale left a comment

Choose a reason for hiding this comment

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

LGTM. I agree that we probably fail elsewhere (e.g. SHA mismatch or even attempting to interact with an empty file), but I also think it's better to fail as close to the source as possible.

@robdimsdale robdimsdale added the semver:patch A change requiring a patch version bump label Mar 31, 2023
@robdimsdale robdimsdale enabled auto-merge (rebase) March 31, 2023 14:09
@robdimsdale robdimsdale merged commit 6e01b44 into paketo-buildpacks:v2 Mar 31, 2023
@phil9909 phil9909 deleted the handle-http-errors branch March 31, 2023 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:patch A change requiring a patch version bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants