mirror of
https://github.com/minio/minio.git
synced 2025-04-18 09:50:02 -04:00
fix return proper error for OperationTimedout (#9117)
OperationTimedout error occurs when locking timesout, trying to acquire a lock. This error should be returned appropriately to the client with http status "408" (request timedout) This translation was broken, fix it.
This commit is contained in:
parent
0af62d35a0
commit
69b2aacf5a
@ -1641,7 +1641,7 @@ func toAPIErrorCode(ctx context.Context, err error) (apiErr APIErrorCode) {
|
|||||||
apiErr = ErrKMSNotConfigured
|
apiErr = ErrKMSNotConfigured
|
||||||
case crypto.ErrKMSAuthLogin:
|
case crypto.ErrKMSAuthLogin:
|
||||||
apiErr = ErrKMSAuthFailure
|
apiErr = ErrKMSAuthFailure
|
||||||
case errOperationTimedOut, context.Canceled, context.DeadlineExceeded:
|
case context.Canceled, context.DeadlineExceeded:
|
||||||
apiErr = ErrOperationTimedOut
|
apiErr = ErrOperationTimedOut
|
||||||
case errDiskNotFound:
|
case errDiskNotFound:
|
||||||
apiErr = ErrSlowDown
|
apiErr = ErrSlowDown
|
||||||
@ -1769,6 +1769,8 @@ func toAPIErrorCode(ctx context.Context, err error) (apiErr APIErrorCode) {
|
|||||||
apiErr = ErrOverlappingFilterNotification
|
apiErr = ErrOverlappingFilterNotification
|
||||||
case *event.ErrUnsupportedConfiguration:
|
case *event.ErrUnsupportedConfiguration:
|
||||||
apiErr = ErrUnsupportedNotification
|
apiErr = ErrUnsupportedNotification
|
||||||
|
case OperationTimedOut:
|
||||||
|
apiErr = ErrOperationTimedOut
|
||||||
case BackendDown:
|
case BackendDown:
|
||||||
apiErr = ErrBackendDown
|
apiErr = ErrBackendDown
|
||||||
case ObjectNameTooLong:
|
case ObjectNameTooLong:
|
||||||
|
@ -50,9 +50,6 @@ var errRPCAPIVersionUnsupported = errors.New("Unsupported rpc API version")
|
|||||||
// errServerTimeMismatch - server times are too far apart.
|
// errServerTimeMismatch - server times are too far apart.
|
||||||
var errServerTimeMismatch = errors.New("Server times are too far apart")
|
var errServerTimeMismatch = errors.New("Server times are too far apart")
|
||||||
|
|
||||||
// errOperationTimedOut
|
|
||||||
var errOperationTimedOut = errors.New("Operation timed out")
|
|
||||||
|
|
||||||
// errInvalidBucketName - bucket name is reserved for MinIO, usually
|
// errInvalidBucketName - bucket name is reserved for MinIO, usually
|
||||||
// returned for 'minio', '.minio.sys', buckets with capital letters.
|
// returned for 'minio', '.minio.sys', buckets with capital letters.
|
||||||
var errInvalidBucketName = errors.New("The specified bucket is not valid")
|
var errInvalidBucketName = errors.New("The specified bucket is not valid")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user