Fix error returned by HealObject in some cases (#11906)

The background healing can return NoSuchUpload error, the reason is that
healing code can return errFileNotFound with three parameters. Simplify
the code by returning exact errUploadNotFound error in multipart code.

Also ensure that a typed error is always returned whatever the number of
parameters because it is better than showing internal error.
This commit is contained in:
Anis Elleuch
2021-03-26 19:17:23 +01:00
committed by GitHub
parent 91eb1fe2ef
commit 8d5456c15a
3 changed files with 115 additions and 92 deletions

View File

@@ -98,3 +98,6 @@ var errAccessDenied = errors.New("Do not have enough permissions to access this
// error returned when object is locked.
var errLockedObject = errors.New("Object is WORM protected and cannot be overwritten or deleted")
// error returned when upload id not found
var errUploadIDNotFound = errors.New("Specified Upload ID is not found")