parent
69032be6b2
commit
2aadccd5b8
@ -0,0 +1,14 @@ |
||||
package rsp |
||||
|
||||
import ( |
||||
"github.com/labstack/echo/v4" |
||||
) |
||||
|
||||
// HTTPErrorHandler 实现 echo.HTTPErrorHandler 函数
|
||||
func HTTPErrorHandler(err error, c echo.Context) { |
||||
if c.Response().Committed { |
||||
c.Logger().Error(err) |
||||
} else if err = Fail(c, err); err != nil { |
||||
c.Logger().Error(err) |
||||
} |
||||
} |
Loading…
Reference in new issue