diff options
Diffstat (limited to 's3_fs.go')
-rw-r--r-- | s3_fs.go | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -113,7 +113,6 @@ func (s S3FS) Rename(ctx context.Context, oldName, newName string) error { //Gather all keys, copy the object, delete the original objCh := s.mc.ListObjects(s.ctx, po.bucket, minio.ListObjectsOptions{Prefix: po.key, Recursive: true}) for obj := range objCh { - log.Println("found object", obj) src := minio.CopySrcOptions{ Bucket: po.bucket, Object: obj.Key, @@ -125,16 +124,17 @@ func (s S3FS) Rename(ctx context.Context, oldName, newName string) error { } _, err := s.mc.CopyObject(s.ctx, dst, src) - log.Println("copy", obj) if err != nil { - log.Println("copy err", err) return err } - log.Println("delete", obj) err = s.mc.RemoveObject(s.ctx, po.bucket, obj.Key, minio.RemoveObjectOptions{}) - if err != nil /*&& err.Code != 200*/ /* @FIXME workaround for garage's bug #98 */ { - log.Println("delete err", err) + var e minio.ErrorResponse + log.Println(errors.As(err, &e)) + log.Println(e) + if errors.As(err, &e) && e.StatusCode == 200 { + /* @FIXME workaround for garage's bug #98 */ + } else if err != nil { return err } } |