From d05178f9edcd460af970386866dd88f74b92f64d Mon Sep 17 00:00:00 2001 From: Thorsieger Date: Wed, 19 Jul 2023 15:16:08 +0200 Subject: [PATCH] fix return code for render_handler --- cmd/carbonapi/http/render_handler.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/carbonapi/http/render_handler.go b/cmd/carbonapi/http/render_handler.go index 56ae44738..860e4f26c 100644 --- a/cmd/carbonapi/http/render_handler.go +++ b/cmd/carbonapi/http/render_handler.go @@ -352,7 +352,8 @@ func renderHandler(w http.ResponseWriter, r *http.Request) { // Obtain error code from the errors // In case we have only "Not Found" errors, result should be 404 // Otherwise it should be 500 - returnCode, errMsgs := helper.MergeHttpErrorMap(errors) + var errMsgs []string + returnCode, errMsgs = helper.MergeHttpErrorMap(errors) logger.Debug("error response or no response", zap.Strings("error", errMsgs)) // Allow override status code for 404-not-found replies. if returnCode == 404 {