From e5a223cd2160ee37e7accbf2e69850b105ac4d76 Mon Sep 17 00:00:00 2001 From: AleksandrMatsko Date: Tue, 10 Sep 2024 13:18:43 +0700 Subject: [PATCH] refactor: change status code returned by `/api/trigger/check` for prometheus errors (except bad data error type) --- api/handler/triggers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/handler/triggers.go b/api/handler/triggers.go index e26e72b74..e25f52876 100644 --- a/api/handler/triggers.go +++ b/api/handler/triggers.go @@ -229,7 +229,7 @@ func triggerCheck(writer http.ResponseWriter, request *http.Request) { render.Render(writer, request, api.ErrorInvalidRequest(fmt.Errorf("invalid prometheus targets: %w", err))) //nolint return default: - render.Render(writer, request, api.ErrorInvalidRequest(err)) //nolint + render.Render(writer, request, api.ErrorInternalServer(err)) //nolint return } default: