metrics: declare request is too large

This commit is contained in:
Victor Shyba 2022-10-14 15:21:06 -03:00
parent 08ed3c9f13
commit 6c082993cf

View file

@ -88,6 +88,7 @@ const (
errBlobTooBig = "blob_too_big" errBlobTooBig = "blob_too_big"
errInvalidPeerJSON = "invalid_peer_json" errInvalidPeerJSON = "invalid_peer_json"
errInvalidPeerData = "invalid_peer_data" errInvalidPeerData = "invalid_peer_data"
errRequestTooLarge = "request_too_large"
errDeadlineExceeded = "deadline_exceeded" errDeadlineExceeded = "deadline_exceeded"
errHashMismatch = "hash_mismatch" errHashMismatch = "hash_mismatch"
errProtectedBlob = "protected_blob" errProtectedBlob = "protected_blob"
@ -304,6 +305,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(), "request is too large") {
errType = errRequestTooLarge
} else if strings.Contains(err.Error(), "Invalid blob hash length") { } else if strings.Contains(err.Error(), "Invalid blob hash length") {
errType = errInvalidBlobHash 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") {