From 30adc6ee15fa9576ddcd766a557d08fea4ef38ce Mon Sep 17 00:00:00 2001 From: Benjamin Pracht Date: Tue, 31 Jan 2023 17:43:59 -0800 Subject: [PATCH] Fix typo in twirp server status code parsing (#1361) --- pkg/service/twirp.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/service/twirp.go b/pkg/service/twirp.go index f57616253..50f3f2dc0 100644 --- a/pkg/service/twirp.go +++ b/pkg/service/twirp.go @@ -184,14 +184,14 @@ func statusReporterResponseSent(ctx context.Context) { var statusFamily string if statusCode, ok := twirp.StatusCode(ctx); ok { - if status, err := strconv.Atoi(statusCode); err != nil { + if status, err := strconv.Atoi(statusCode); err == nil { switch { case status >= 400 && status <= 499: statusFamily = "4xx" case status >= 500 && status <= 599: statusFamily = "5xx" default: - statusFamily = strconv.Itoa(status) + statusFamily = statusCode } } }