summaryrefslogtreecommitdiffstats
path: root/routers/api/packages/maven/maven.go
diff options
context:
space:
mode:
authoroliverpool <git@olivier.pfad.fr>2024-03-19 16:21:30 +0100
committeroliverpool <git@olivier.pfad.fr>2024-03-24 07:12:31 +0100
commitfb6bcf10293fb41f806658c42ffe7764f1effc40 (patch)
tree42069abfbf9ce9431882782eb8c6fc531c05d783 /routers/api/packages/maven/maven.go
parentpackages: skip error logging on duplicate (diff)
downloadforgejo-fb6bcf10293fb41f806658c42ffe7764f1effc40.tar.xz
forgejo-fb6bcf10293fb41f806658c42ffe7764f1effc40.zip
packages/maven: log.Warn on bad request
Diffstat (limited to '')
-rw-r--r--routers/api/packages/maven/maven.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/routers/api/packages/maven/maven.go b/routers/api/packages/maven/maven.go
index 27f0578db7..7571797593 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)
}