Send HTTP error code when failing to decode payload
This commit is contained in:
parent
d2eef546d5
commit
3baffc9bef
1 changed files with 1 additions and 0 deletions
1
main.go
1
main.go
|
@ -401,6 +401,7 @@ func (br *bridge) handleWebhooks(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var event payload
|
var event payload
|
||||||
if err := json.NewDecoder(r.Body).Decode(&event); err != nil {
|
if err := json.NewDecoder(r.Body).Decode(&event); err != nil {
|
||||||
|
http.Error(w, "Failed to parse payload", http.StatusInternalServerError)
|
||||||
logger.Debug("Failed to decode payload",
|
logger.Debug("Failed to decode payload",
|
||||||
slog.String("error", err.Error()))
|
slog.String("error", err.Error()))
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue