Skip to content

Commit

Permalink
bus: improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjan committed Dec 14, 2023
1 parent 24817b1 commit 36a8397
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bus/bus.go
Original file line number Diff line number Diff line change
Expand Up @@ -2066,7 +2066,11 @@ func (b *bus) metricsHandlerGET(jc jape.Context) {
if jc.DecodeForm("n", &n) != nil {
return
} else if n == 0 {
jc.Error(errors.New("parameter 'n' is required"), http.StatusBadRequest)
if jc.Request.FormValue("n") == "" {
jc.Error(errors.New("parameter 'n' is required"), http.StatusBadRequest)
} else {
jc.Error(errors.New("'n' has to be greater than zero"), http.StatusBadRequest)
}
return
}

Expand Down

0 comments on commit 36a8397

Please sign in to comment.