From 6c082993cf8fb898453396d52d360514ad7ef290 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Fri, 14 Oct 2022 15:21:06 -0300 Subject: [PATCH] metrics: declare request is too large --- internal/metrics/metrics.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/metrics/metrics.go b/internal/metrics/metrics.go index cf2d558..f1c99ee 100644 --- a/internal/metrics/metrics.go +++ b/internal/metrics/metrics.go @@ -88,6 +88,7 @@ const ( errBlobTooBig = "blob_too_big" errInvalidPeerJSON = "invalid_peer_json" errInvalidPeerData = "invalid_peer_data" + errRequestTooLarge = "request_too_large" errDeadlineExceeded = "deadline_exceeded" errHashMismatch = "hash_mismatch" errProtectedBlob = "protected_blob" @@ -304,6 +305,8 @@ func TrackError(direction string, e error) (shouldLog bool) { // shouldLog is a errType = errInvalidPeerJSON } else if strings.Contains(err.Error(), "Invalid data") { errType = errInvalidPeerData + } else if strings.Contains(err.Error(), "request is too large") { + errType = errRequestTooLarge } 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") {