#829 prior to use service error

This commit is contained in:
smallnest
2023-11-24 11:45:52 +08:00
parent 0e143cfe89
commit f421af9252
2 changed files with 5 additions and 2 deletions

View File

@@ -315,7 +315,7 @@ func (p *pluginContainer) DoPreCall(ctx context.Context, serviceName, methodName
// DoPostCall invokes PostCallPlugin plugin.
func (p *pluginContainer) DoPostCall(ctx context.Context, serviceName, methodName string, args, reply interface{}, err error) (interface{}, error) {
e := err
var e error
for i := range p.plugins {
if plugin, ok := p.plugins[i].(PostCallPlugin); ok {
reply, e = plugin.PostCall(ctx, serviceName, methodName, args, reply, err)

View File

@@ -825,7 +825,10 @@ func (s *Server) handleRequestForFunction(ctx context.Context, req *protocol.Mes
err = service.callForFunction(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
}
reflectTypePools.Put(mtype.ArgType, argv)
if err != nil {