mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
do not log checksum mismatch error, client received the error (#16246)
This commit is contained in:
@@ -17,7 +17,10 @@
|
||||
|
||||
package hash
|
||||
|
||||
import "fmt"
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// SHA256Mismatch - when content sha256 does not match with what was sent from client.
|
||||
type SHA256Mismatch struct {
|
||||
@@ -58,3 +61,9 @@ type ChecksumMismatch struct {
|
||||
func (e ChecksumMismatch) Error() string {
|
||||
return "Bad checksum: Want " + e.Want + " does not match calculated " + e.Got
|
||||
}
|
||||
|
||||
// IsChecksumMismatch matches if 'err' is hash.ChecksumMismatch
|
||||
func IsChecksumMismatch(err error) bool {
|
||||
var herr ChecksumMismatch
|
||||
return errors.As(err, &herr)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user