#825 fix clients have not received server errors

This commit is contained in:
smallnest
2023-11-16 23:40:46 +08:00
parent 2781b4c50d
commit 4c029824c7
2 changed files with 6 additions and 2 deletions

2
.gitignore vendored
View File

@@ -6,3 +6,5 @@ vendor/
.idea
cover.html
.history

View File

@@ -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)