packages/maven: log.Warn on bad request

This commit is contained in:
oliverpool 2024-03-19 16:21:30 +01:00
parent dda88488ca
commit fb6bcf1029

View file

@ -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)
}