Skip to content

Commit

Permalink
Use lint reco for errors.as
Browse files Browse the repository at this point in the history
  • Loading branch information
yahgwai committed Feb 1, 2024
1 parent b9a1c49 commit e8167fe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions util/rpcclient/rpcclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,9 @@ func (c *RpcClient) CallContext(ctx_in context.Context, result interface{}, meth
"attempt", i,
"args", limitedArgumentsMarshal{limit, args},
}
if da, ok := err.(rpc.DataError); ok {
logEntry = append(logEntry, "errorData", limitedMarshal{limit, da.ErrorData()})
var dataErr rpc.DataError
if errors.As(err, &dataErr) {
logEntry = append(logEntry, "errorData", limitedMarshal{limit, dataErr.ErrorData()})
}
logger("rpc response", logEntry...)
if err == nil {
Expand Down

0 comments on commit e8167fe

Please sign in to comment.