go项目脚手架
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sorbet/pkg/rsp/error_handler.go

14 lines
289 B

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)
}
}