mirror of https://github.com/restic/restic.git
Merge pull request #1660 from ncw/rest-fix
backend/rest: check HTTP error response for List
This commit is contained in:
commit
ab5ef600a2
|
@ -335,7 +335,11 @@ func (b *restBackend) List(ctx context.Context, t restic.FileType, fn func(resti
|
||||||
b.sem.ReleaseToken()
|
b.sem.ReleaseToken()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "Get")
|
return errors.Wrap(err, "List")
|
||||||
|
}
|
||||||
|
|
||||||
|
if resp.StatusCode != 200 {
|
||||||
|
return errors.Errorf("List failed, server response: %v (%v)", resp.Status, resp.StatusCode)
|
||||||
}
|
}
|
||||||
|
|
||||||
if resp.Header.Get("Content-Type") == contentTypeV2 {
|
if resp.Header.Get("Content-Type") == contentTypeV2 {
|
||||||
|
|
Loading…
Reference in New Issue