Skip to content

Commit

Permalink
fix: wrap binding request error by statuserros
Browse files Browse the repository at this point in the history
  • Loading branch information
tangx committed Dec 10, 2021
1 parent 5e7387e commit 3b9cd61
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions rum/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ package rum

var (
NotRunWithListenAndServe = "rum not run with ListenAndServe method"
BindingRequestError = "binding request params failed"
)
1 change: 1 addition & 0 deletions rum/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ func (r *RouterGroup) handlerfunc(op Operator) HandlerFunc {

err := ginbinder.ShouldBindRequest(c, op)
if err != nil {
err = statuserrors.Wrap(err, http.StatusBadRequest, BindingRequestError)
r.output(c, nil, err)
return
}
Expand Down

0 comments on commit 3b9cd61

Please sign in to comment.