Skip to content
This repository has been archived by the owner on Feb 8, 2023. It is now read-only.

Commit

Permalink
feat: handle panic in json-mask package
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidCai1111 committed Jan 31, 2018
1 parent 2177abc commit 8a21f00
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ func (s *Sender) Send(ctx *gear.Context, code int, data interface{}) (err error)
return ctx.JSON(code, data)
}

defer func() {
if recover() != nil {
err = ctx.JSON(code, data)
}
}()

maskedData, err := mask.Mask(data, ctx.Query(s.query))

if err != nil {
Expand Down

0 comments on commit 8a21f00

Please sign in to comment.