From 4c029824c7ce08def48557b81e502615d86fdad3 Mon Sep 17 00:00:00 2001 From: smallnest Date: Thu, 16 Nov 2023 23:40:46 +0800 Subject: [PATCH] #825 fix clients have not received server errors --- .gitignore | 2 ++ server/server.go | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 3132a24b..0d45d5b1 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ vendor/ .idea cover.html + +.history \ No newline at end of file diff --git a/server/server.go b/server/server.go index 2d410199..2e9e0b18 100644 --- a/server/server.go +++ b/server/server.go @@ -722,7 +722,10 @@ func (s *Server) handleRequest(ctx context.Context, req *protocol.Message) (res err = service.call(ctx, mtype, reflect.ValueOf(argv), reflect.ValueOf(replyv)) } - replyv, err = s.Plugins.DoPostCall(ctx, serviceName, methodName, argv, replyv, err) + replyv, err1 := s.Plugins.DoPostCall(ctx, serviceName, methodName, argv, replyv, err) + if err == nil { + err = err1 + } // return argc to object pool reflectTypePools.Put(mtype.ArgType, argv) @@ -809,7 +812,6 @@ func (s *Server) handleRequestForFunction(ctx context.Context, req *protocol.Mes replyv, err = s.Plugins.DoPostCall(ctx, serviceName, methodName, argv, replyv, err) reflectTypePools.Put(mtype.ArgType, argv) - if err != nil { reflectTypePools.Put(mtype.ReplyType, replyv) return s.handleError(res, err)