Skip to content

Commit

Permalink
#825 fix clients have not received server errors
Browse files Browse the repository at this point in the history
  • Loading branch information
smallnest committed Nov 16, 2023
1 parent 2781b4c commit 4c02982
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ vendor/
.idea

cover.html

.history
6 changes: 4 additions & 2 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 4c02982

Please sign in to comment.