From d267f274f05ea9772d6583678e60c877474f3b24 Mon Sep 17 00:00:00 2001 From: Douglas Camata <159076+douglascamata@users.noreply.github.com> Date: Tue, 21 Jun 2022 10:40:56 +0200 Subject: [PATCH] Make error handling code shorter Co-authored-by: Bartlomiej Plotka --- pkg/receive/handler.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/receive/handler.go b/pkg/receive/handler.go index 00c556218aa..ea93159793b 100644 --- a/pkg/receive/handler.go +++ b/pkg/receive/handler.go @@ -396,8 +396,7 @@ func (h *Handler) receiveHTTP(w http.ResponseWriter, r *http.Request) { } responseStatusCode := http.StatusOK - err = h.handleRequest(ctx, rep, tenant, &wreq) - if err != nil { + if err = h.handleRequest(ctx, rep, tenant, &wreq); err != nil { level.Debug(tLogger).Log("msg", "failed to handle request", "err", err) switch determineWriteErrorCause(err, 1) { case errNotReady: