mirror of
https://github.com/minio/minio.git
synced 2025-11-21 02:09:08 -05:00
madmin: All APIs return ErrorResponse error type (#3632)
Avoid returning errors.New("Got HTTP Status") in all APIs
This commit is contained in:
committed by
Harshavardhana
parent
82373e3d50
commit
c753b5dfeb
@@ -19,7 +19,6 @@ package madmin
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
@@ -118,7 +117,7 @@ func (adm *AdminClient) ListLocks(bucket, prefix string, olderThan time.Duration
|
||||
}
|
||||
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return nil, errors.New("Got HTTP Status: " + resp.Status)
|
||||
return nil, httpRespToErrorResponse(resp)
|
||||
}
|
||||
|
||||
return getLockInfos(resp.Body)
|
||||
@@ -150,7 +149,7 @@ func (adm *AdminClient) ClearLocks(bucket, prefix string, olderThan time.Duratio
|
||||
}
|
||||
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return nil, errors.New("Got HTTP Status: " + resp.Status)
|
||||
return nil, httpRespToErrorResponse(resp)
|
||||
}
|
||||
|
||||
return getLockInfos(resp.Body)
|
||||
|
||||
Reference in New Issue
Block a user