Skip to content

Commit

Permalink
fix: log source url on http download failure (#400)
Browse files Browse the repository at this point in the history
context: when hitting a download error the log only has the url in
hermit manifest but not the one from the source.

we are trying to figure out why hermit is getting 429 which does seem to
come from github straight instead of the internal source url.
  • Loading branch information
lyonlai committed Apr 10, 2024
1 parent 08045a2 commit 052bc2d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cache/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (s *httpSource) Validate() error {

func downloadHTTP(b *ui.Task, response *http.Response, checksum string, uri string, cachePath string) (path string, etag string, returnChecksum string, err error) {
if response.StatusCode < 200 || response.StatusCode > 299 {
return "", "", "", errors.Errorf("download failed: %s (%d)", response.Status, response.StatusCode)
return "", "", "", errors.Errorf("download failed: %s (%d), source url: %s", response.Status, response.StatusCode, uri)
}
task := b.SubTask("download")
cacheDir := filepath.Dir(cachePath)
Expand Down

0 comments on commit 052bc2d

Please sign in to comment.