Skip to content

Commit

Permalink
Don't return a ChiaRPCError if we don't have an actual resp from the … (
Browse files Browse the repository at this point in the history
  • Loading branch information
cmmarslender authored Dec 1, 2024
1 parent ee7ea7a commit a34eef4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/rpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ func (c *Client) Do(req *rpcinterface.Request, v rpcinterface.IResponse) (*http.
if err != nil {
return resp, err
}
if !v.IsSuccessful() {
// resp will be nil in async websocket requests
// Any time we have a nil response, it's not a case of the RPC returning success: false, it's just a default value
if resp != nil && !v.IsSuccessful() {
return resp, &rpcinterface.ChiaRPCError{Message: v.GetRPCError()}
}
return resp, nil
Expand Down

0 comments on commit a34eef4

Please sign in to comment.