From fb6bcf10293fb41f806658c42ffe7764f1effc40 Mon Sep 17 00:00:00 2001 From: oliverpool Date: Tue, 19 Mar 2024 16:21:30 +0100 Subject: [PATCH] packages/maven: log.Warn on bad request --- routers/api/packages/maven/maven.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/routers/api/packages/maven/maven.go b/routers/api/packages/maven/maven.go index 27f0578db..757179759 100644 --- a/routers/api/packages/maven/maven.go +++ b/routers/api/packages/maven/maven.go @@ -49,7 +49,10 @@ var ( func apiError(ctx *context.Context, status int, obj any) { helper.LogAndProcessError(ctx, status, obj, func(message string) { // The maven client does not present the error message to the user. Log it for users with access to server logs. - if status == http.StatusBadRequest || status == http.StatusInternalServerError { + switch status { + case http.StatusBadRequest: + log.Warn(message) + case http.StatusInternalServerError: log.Error(message) }