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.
15 lines
289 B
15 lines
289 B
1 year ago
|
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)
|
||
|
}
|
||
|
}
|