fix: do not overwrite error on fallback. (#13415)

older content was returning '404' upon headObject()
due to swallowing of the error, make sure the
error is handling independently.

fixes #13397
This commit is contained in:
Harshavardhana
2021-10-11 19:48:42 -07:00
committed by GitHub
parent 91a0e7bdaa
commit f5a55c44d4
2 changed files with 31 additions and 1 deletions

View File

@@ -1077,7 +1077,7 @@ func (s *xlStorage) ReadVersion(ctx context.Context, volume, path, versionID str
buf, err = s.readMetadata(ctx, pathJoin(volumeDir, path, xlStorageFormatFile))
if err != nil {
if osIsNotExist(err) {
if err = Access(volumeDir); err != nil && osIsNotExist(err) {
if aerr := Access(volumeDir); aerr != nil && osIsNotExist(aerr) {
return fi, errVolumeNotFound
}
}