fix: return context error from context reader (#9507)

This commit is contained in:
Harshavardhana
2020-05-04 14:33:49 -07:00
committed by GitHub
parent fea4a1e68e
commit 7b58dcb28c
4 changed files with 14 additions and 9 deletions

View File

@@ -17,6 +17,7 @@
package cmd
import (
"context"
"errors"
"fmt"
"io"
@@ -106,6 +107,8 @@ func toObjectErr(err error, params ...string) error {
err = InsufficientWriteQuorum{}
case io.ErrUnexpectedEOF, io.ErrShortWrite:
err = IncompleteBody{}
case context.Canceled, context.DeadlineExceeded:
err = IncompleteBody{}
}
return err
}