From 6d2a60e3fabc076319982d896e22547391a4e583 Mon Sep 17 00:00:00 2001 From: NoahLan <6995syu@163.com> Date: Tue, 17 Oct 2023 11:32:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dcause=E6=97=A0?= =?UTF-8?q?=E9=99=90=E5=BE=AA=E7=8E=AF=E7=9A=84=E9=97=AE=E9=A2=98=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=20context=20deadline?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/nstatus/grpc_interceptor.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/nstatus/grpc_interceptor.go b/core/nstatus/grpc_interceptor.go index a9a6397..f063c98 100644 --- a/core/nstatus/grpc_interceptor.go +++ b/core/nstatus/grpc_interceptor.go @@ -2,7 +2,6 @@ package nstatus import ( "context" - "github.com/pkg/errors" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" @@ -16,8 +15,7 @@ func UnaryServerInterceptor() grpc.UnaryServerInterceptor { return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) { resp, err = handler(ctx, req) if err != nil { - cause := errors.Cause(err) - e := ConvertErr(cause) + e := ConvertErr(err) if e != nil { writeResultTypeCtx(ctx, e) // 转换为grpc-err