From 08fd5f250fc840cb8a6fa24f21a7ca62679cdff0 Mon Sep 17 00:00:00 2001 From: ElvinChan Date: Mon, 13 Jan 2020 09:06:27 +0800 Subject: [PATCH] #27 Fix missing error info in behaviorlog --- controllers/utils.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/controllers/utils.go b/controllers/utils.go index 30e3d6b..9708cad 100644 --- a/controllers/utils.go +++ b/controllers/utils.go @@ -9,6 +9,7 @@ import ( "github.com/go-xorm/xorm" "github.com/labstack/echo" "github.com/pangpanglabs/echosample/factory" + "github.com/pangpanglabs/goutils/behaviorlog" ) const ( @@ -58,6 +59,7 @@ func ReturnApiFail(c echo.Context, status int, apiError ApiError, err error, v . str := "" if err != nil { str = err.Error() + behaviorlog.FromCtx(c.Request().Context()).WithError(err) } return c.JSON(status, ApiResult{ Success: false,