Skip to content

Commit

Permalink
Add error logging for invalid uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmelon54 committed Jan 19, 2025
1 parent bda939c commit 34ccdd8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions upload/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 34ccdd8

Please sign in to comment.