Show SlowDown error message if backend is busy (#7521)

or if there are too many open file descriptors.
This commit is contained in:
poornas
2019-05-02 07:09:57 -07:00
committed by kannappanr
parent 64998fc4ab
commit cf2a436bc8
8 changed files with 55 additions and 3 deletions

View File

@@ -1485,7 +1485,6 @@ func toAPIErrorCode(ctx context.Context, err error) (apiErr APIErrorCode) {
if err == nil {
return ErrNone
}
// Verify if the underlying error is signature mismatch.
switch err {
case errInvalidArgument:
@@ -1535,6 +1534,8 @@ func toAPIErrorCode(ctx context.Context, err error) (apiErr APIErrorCode) {
apiErr = ErrKMSAuthFailure
case errOperationTimedOut, context.Canceled, context.DeadlineExceeded:
apiErr = ErrOperationTimedOut
case errNetworkConnReset:
apiErr = ErrSlowDown
}
// Compression errors