add missing proper error return in WalkDir() (#18884)

without this the caller might end up returning
incorrect errors and not ignoring the drive
properly.
This commit is contained in:
Harshavardhana
2024-01-27 16:13:41 -08:00
committed by GitHub
parent 32e668eb94
commit 6347fb6636
2 changed files with 14 additions and 2 deletions

View File

@@ -87,6 +87,8 @@ func toStorageErr(err error) error {
switch err.Error() {
case errFaultyDisk.Error():
return errFaultyDisk
case errFaultyRemoteDisk.Error():
return errFaultyRemoteDisk
case errFileCorrupt.Error():
return errFileCorrupt
case errUnexpected.Error():
@@ -135,6 +137,16 @@ func toStorageErr(err error) error {
return errDiskNotFound
case errDiskNotFound.Error():
return errDiskNotFound
case errMaxVersionsExceeded.Error():
return errMaxVersionsExceeded
case errInconsistentDisk.Error():
return errInconsistentDisk
case errDriveIsRoot.Error():
return errDriveIsRoot
case errDiskOngoingReq.Error():
return errDiskOngoingReq
case grid.ErrUnknownHandler.Error():
return errInconsistentDisk
}
return err
}