From 8c2a46752cb9dfa2e670e18ef8847fa7414a3c07 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Fri, 14 Oct 2022 14:42:22 -0300 Subject: [PATCH] declare errInvalidPeerData on metrics --- internal/metrics/metrics.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/metrics/metrics.go b/internal/metrics/metrics.go index d6a93fd..11da2b7 100644 --- a/internal/metrics/metrics.go +++ b/internal/metrics/metrics.go @@ -86,6 +86,7 @@ const ( errUnexpectedEOFStr = "unexpected_eof_str" errJSONSyntax = "json_syntax" errBlobTooBig = "blob_too_big" + errInvalidPeerData = "invalid_peer_data" errDeadlineExceeded = "deadline_exceeded" errHashMismatch = "hash_mismatch" errZeroByteBlob = "zero_byte_blob" @@ -296,6 +297,8 @@ func TrackError(direction string, e error) (shouldLog bool) { // shouldLog is a } else if strings.Contains(err.Error(), "blob must be at most") { //log.Warnln("blob must be at most X bytes is not the same as ErrBlobTooBig") errType = errBlobTooBig + } else if strings.Contains(err.Error(), "Invalid data") { + errType = errInvalidPeerData } else if strings.Contains(err.Error(), "hash of received blob data does not match hash from send request") { errType = errHashMismatch } else if strings.Contains(err.Error(), "blob not found") { -- 2.45.2