mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-03-22 11:01:52 +00:00
Merge branch 'master' of github.com:nezhahq/nezha
This commit is contained in:
@@ -198,6 +198,8 @@ func (we *wsError) Error() string {
|
||||
return fmt.Sprintf(we.msg, we.a...)
|
||||
}
|
||||
|
||||
var errNoop = errors.New("wrote")
|
||||
|
||||
func commonHandler[T any](handler handlerFunc[T]) func(*gin.Context) {
|
||||
return func(c *gin.Context) {
|
||||
handle(c, handler)
|
||||
@@ -240,7 +242,9 @@ func handle[T any](c *gin.Context, handler handlerFunc[T]) {
|
||||
}
|
||||
return
|
||||
default:
|
||||
c.JSON(http.StatusOK, newErrorResponse(err))
|
||||
if !errors.Is(err, errNoop) {
|
||||
c.JSON(http.StatusOK, newErrorResponse(err))
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user