forked from TrueCloudLab/restic
Merge pull request #1828 from restic/handle-s3-list-errors
s3: Pass list errors up to the caller
This commit is contained in:
commit
cfc19b4582
1 changed files with 8 additions and 0 deletions
|
@ -188,6 +188,10 @@ func (be *Backend) ReadDir(dir string) (list []os.FileInfo, err error) {
|
||||||
defer close(done)
|
defer close(done)
|
||||||
|
|
||||||
for obj := range be.client.ListObjects(be.cfg.Bucket, dir, false, done) {
|
for obj := range be.client.ListObjects(be.cfg.Bucket, dir, false, done) {
|
||||||
|
if obj.Err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
if obj.Key == "" {
|
if obj.Key == "" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -424,6 +428,10 @@ func (be *Backend) List(ctx context.Context, t restic.FileType, fn func(restic.F
|
||||||
listresp := be.client.ListObjects(be.cfg.Bucket, prefix, recursive, ctx.Done())
|
listresp := be.client.ListObjects(be.cfg.Bucket, prefix, recursive, ctx.Done())
|
||||||
|
|
||||||
for obj := range listresp {
|
for obj := range listresp {
|
||||||
|
if obj.Err != nil {
|
||||||
|
return obj.Err
|
||||||
|
}
|
||||||
|
|
||||||
m := strings.TrimPrefix(obj.Key, prefix)
|
m := strings.TrimPrefix(obj.Key, prefix)
|
||||||
if m == "" {
|
if m == "" {
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in a new issue