Skip to content

Commit

Permalink
Merge pull request #14 from tonistiigi/tonistiigi/416-error
Browse files Browse the repository at this point in the history
return more specific error for 416
  • Loading branch information
tonistiigi authored Apr 4, 2022
2 parents 9642704 + 6c9ed76 commit 0bdeb6e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,9 @@ func (ce *Entry) Download(ctx context.Context) ReaderAtCloser {
return nil, errors.WithStack(err)
}
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
if resp.StatusCode == http.StatusRequestedRangeNotSatisfiable {
return nil, errors.Errorf("invalid status response %v for %s, range: %v", resp.Status, ce.URL, req.Header.Get("Range"))
}
return nil, errors.Errorf("invalid status response %v for %s", resp.Status, ce.URL)
}
if offset != 0 {
Expand Down

0 comments on commit 0bdeb6e

Please sign in to comment.