mirror of
https://github.com/pgsty/minio.git
synced 2026-10-06 17:55:59 +03:00
Align some checksum error messages with S3
Signed-off-by: cbornet <cbornet@hotmail.com>
This commit is contained in:
+1
-1
@@ -550,7 +550,7 @@ var errorCodes = errorCodeMap{
|
|||||||
},
|
},
|
||||||
ErrBadDigest: {
|
ErrBadDigest: {
|
||||||
Code: "BadDigest",
|
Code: "BadDigest",
|
||||||
Description: "The Content-Md5 you specified did not match what we received.",
|
Description: "The Content-MD5 you specified did not match what we received.",
|
||||||
HTTPStatusCode: http.StatusBadRequest,
|
HTTPStatusCode: http.StatusBadRequest,
|
||||||
},
|
},
|
||||||
ErrEntityTooSmall: {
|
ErrEntityTooSmall: {
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ func testAPICompleteMultipartFullObjectChecksumMismatch(obj ObjectLayer, instanc
|
|||||||
if apiErr.Code != "BadDigest" {
|
if apiErr.Code != "BadDigest" {
|
||||||
t.Fatalf("%s: expected BadDigest, got %q", instanceType, apiErr.Code)
|
t.Fatalf("%s: expected BadDigest, got %q", instanceType, apiErr.Code)
|
||||||
}
|
}
|
||||||
if want := "The CRC32 checksum you specified did not match the calculated checksum."; apiErr.Message != want {
|
if want := "The CRC32 you specified did not match the calculated checksum."; apiErr.Message != want {
|
||||||
t.Fatalf("%s: expected message %q, got %q", instanceType, want, apiErr.Message)
|
t.Fatalf("%s: expected message %q, got %q", instanceType, want, apiErr.Message)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -361,7 +361,7 @@ func testAPICompleteMultipartCompositeChecksumMismatch(obj ObjectLayer, instance
|
|||||||
if apiErr.Code != "BadDigest" {
|
if apiErr.Code != "BadDigest" {
|
||||||
t.Fatalf("%s: expected BadDigest, got %q", instanceType, apiErr.Code)
|
t.Fatalf("%s: expected BadDigest, got %q", instanceType, apiErr.Code)
|
||||||
}
|
}
|
||||||
if want := "The CRC32 checksum you specified did not match the calculated checksum."; apiErr.Message != want {
|
if want := "The CRC32 you specified did not match the calculated checksum."; apiErr.Message != want {
|
||||||
t.Fatalf("%s: expected message %q, got %q", instanceType, want, apiErr.Message)
|
t.Fatalf("%s: expected message %q, got %q", instanceType, want, apiErr.Message)
|
||||||
}
|
}
|
||||||
if _, err := obj.GetObjectInfo(t.Context(), bucketName, objectName, ObjectOptions{}); err == nil {
|
if _, err := obj.GetObjectInfo(t.Context(), bucketName, objectName, ObjectOptions{}); err == nil {
|
||||||
|
|||||||
@@ -668,7 +668,7 @@ var (
|
|||||||
func completeMultipartChecksumMismatch(algorithm string) error {
|
func completeMultipartChecksumMismatch(algorithm string) error {
|
||||||
description := "The checksum you specified did not match the calculated checksum."
|
description := "The checksum you specified did not match the calculated checksum."
|
||||||
if algorithm != "" {
|
if algorithm != "" {
|
||||||
description = fmt.Sprintf("The %s checksum you specified did not match the calculated checksum.", algorithm)
|
description = fmt.Sprintf("The %s you specified did not match the calculated checksum.", algorithm)
|
||||||
}
|
}
|
||||||
return fmt.Errorf("%w: %s", errCompleteMultipartChecksumMismatch, description)
|
return fmt.Errorf("%w: %s", errCompleteMultipartChecksumMismatch, description)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user