metrics: declare invalid blob hash len
This commit is contained in:
parent
7f75602841
commit
08ed3c9f13
1 changed files with 3 additions and 0 deletions
|
@ -91,6 +91,7 @@ const (
|
||||||
errDeadlineExceeded = "deadline_exceeded"
|
errDeadlineExceeded = "deadline_exceeded"
|
||||||
errHashMismatch = "hash_mismatch"
|
errHashMismatch = "hash_mismatch"
|
||||||
errProtectedBlob = "protected_blob"
|
errProtectedBlob = "protected_blob"
|
||||||
|
errInvalidBlobHash = "invalid_blob_hash"
|
||||||
errZeroByteBlob = "zero_byte_blob"
|
errZeroByteBlob = "zero_byte_blob"
|
||||||
errInvalidCharacter = "invalid_character"
|
errInvalidCharacter = "invalid_character"
|
||||||
errBlobNotFound = "blob_not_found"
|
errBlobNotFound = "blob_not_found"
|
||||||
|
@ -303,6 +304,8 @@ func TrackError(direction string, e error) (shouldLog bool) { // shouldLog is a
|
||||||
errType = errInvalidPeerJSON
|
errType = errInvalidPeerJSON
|
||||||
} else if strings.Contains(err.Error(), "Invalid data") {
|
} else if strings.Contains(err.Error(), "Invalid data") {
|
||||||
errType = errInvalidPeerData
|
errType = errInvalidPeerData
|
||||||
|
} else if strings.Contains(err.Error(), "Invalid blob hash length") {
|
||||||
|
errType = errInvalidBlobHash
|
||||||
} else if strings.Contains(err.Error(), "hash of received blob data does not match hash from send request") {
|
} else if strings.Contains(err.Error(), "hash of received blob data does not match hash from send request") {
|
||||||
errType = errHashMismatch
|
errType = errHashMismatch
|
||||||
} else if strings.Contains(err.Error(), "blob not found") {
|
} else if strings.Contains(err.Error(), "blob not found") {
|
||||||
|
|
Loading…
Reference in a new issue