From 6df50d97e914ea64b80bb78dec0e112b650af041 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Sat, 5 Jun 2021 11:35:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BRPC=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/web/actions/actionutils/utils.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/web/actions/actionutils/utils.go b/internal/web/actions/actionutils/utils.go index dbcf169e..8f0a2522 100644 --- a/internal/web/actions/actionutils/utils.go +++ b/internal/web/actions/actionutils/utils.go @@ -3,6 +3,7 @@ package actionutils import ( "fmt" teaconst "github.com/TeaOSLab/EdgeAdmin/internal/const" + rpcerrors "github.com/TeaOSLab/EdgeCommon/pkg/rpc/errors" "github.com/iwind/TeaGo/actions" "github.com/iwind/TeaGo/logs" "net/http" @@ -26,6 +27,7 @@ func FailPage(action actions.ActionWrapper, err error) { if err != nil { logs.Println("[" + reflect.TypeOf(action).String() + "]" + findStack(err.Error())) } + err = rpcerrors.HumanError(err) action.Object().ResponseWriter.WriteHeader(http.StatusInternalServerError) if len(action.Object().Request.Header.Get("X-Requested-With")) > 0 { action.Object().WriteString(teaconst.ErrServer)