Skip to content

Commit

Permalink
#850 must handle errors of DoPreCall of clients
Browse files Browse the repository at this point in the history
  • Loading branch information
smallnest committed Jan 28, 2025
1 parent a09a362 commit 90032e5
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions client/xclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -891,8 +891,11 @@ func (c *xClient) wrapCall(ctx context.Context, client RPCClient, serviceMethod
ctx = share.NewContext(ctx)
}

c.Plugins.DoPreCall(ctx, c.servicePath, serviceMethod, args)
err := client.Call(ctx, c.servicePath, serviceMethod, args, reply)
err := c.Plugins.DoPreCall(ctx, c.servicePath, serviceMethod, args)
if err != nil {
return err
}
err = client.Call(ctx, c.servicePath, serviceMethod, args, reply)
c.Plugins.DoPostCall(ctx, c.servicePath, serviceMethod, args, reply, err)

if share.Trace {
Expand All @@ -913,7 +916,11 @@ func (c *xClient) wrapSendRaw(ctx context.Context, client RPCClient, r *protocol
}

ctx = share.NewContext(ctx)
c.Plugins.DoPreCall(ctx, c.servicePath, r.ServiceMethod, r.Payload)
err := c.Plugins.DoPreCall(ctx, c.servicePath, r.ServiceMethod, r.Payload)
if err != nil {
return nil, nil, err
}

m, payload, err := client.SendRaw(ctx, r)
c.Plugins.DoPostCall(ctx, c.servicePath, r.ServiceMethod, r.Payload, nil, err)

Expand Down

0 comments on commit 90032e5

Please sign in to comment.