From 34ccdd8caadaac71d67d1da3ae532d3a58629d29 Mon Sep 17 00:00:00 2001 From: MrMelon54 Date: Sun, 19 Jan 2025 00:33:36 +0000 Subject: [PATCH] Add error logging for invalid uploads --- upload/upload.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/upload/upload.go b/upload/upload.go index a79e259..5fffa40 100644 --- a/upload/upload.go +++ b/upload/upload.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/1f349/bluebell/database" "github.com/1f349/bluebell/hook" + "github.com/1f349/bluebell/logger" "github.com/1f349/bluebell/validation" "github.com/1f349/syncmap" "github.com/dustin/go-humanize" @@ -80,6 +81,7 @@ func (h *Handler) Handle(rw http.ResponseWriter, req *http.Request, params httpr if errors.Unwrap(err) == nil { http.Error(rw, fmt.Sprintf("Invalid upload: %s", err), http.StatusBadRequest) } else { + logger.Logger.Error("Invalid upload", "site", site, "branch", branch, "err", err) http.Error(rw, "Invalid upload: [Internal Server Error]", http.StatusBadRequest) } return