diff --git a/cmd/api-errors.go b/cmd/api-errors.go index 46c57c327..1301d8ce7 100644 --- a/cmd/api-errors.go +++ b/cmd/api-errors.go @@ -1794,8 +1794,6 @@ func toAPIErrorCode(ctx context.Context, err error) (apiErr APIErrorCode) { } switch err { - case errVolumeNotFound: - apiErr = ErrNoSuchBucket case errInvalidArgument: apiErr = ErrAdminInvalidArgument case errNoSuchUser: diff --git a/cmd/bucket-metadata.go b/cmd/bucket-metadata.go index 41bb32436..f2142a0f3 100644 --- a/cmd/bucket-metadata.go +++ b/cmd/bucket-metadata.go @@ -123,9 +123,6 @@ func (b *BucketMetadata) Load(ctx context.Context, api ObjectLayer, name string) configFile := path.Join(bucketConfigPrefix, name, bucketMetadataFile) data, err := readConfig(ctx, api, configFile) if err != nil { - if err == errConfigNotFound { - err = errVolumeNotFound - } return err } if len(data) <= 4 { @@ -152,7 +149,7 @@ func (b *BucketMetadata) Load(ctx context.Context, api ObjectLayer, name string) func loadBucketMetadata(ctx context.Context, objectAPI ObjectLayer, bucket string) (BucketMetadata, error) { b := newBucketMetadata(bucket) err := b.Load(ctx, objectAPI, b.Name) - if err != nil { + if err != nil && !errors.Is(err, errConfigNotFound) { return b, err }