Skip to content

Commit

Permalink
fix: In gnoclient Render and QEval, need to check Response.Error
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Thompson <jeff@thefirst.org>
  • Loading branch information
jefft0 committed Nov 30, 2023
1 parent 89f112c commit f1059c7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gno.land/pkg/gnoclient/client_queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ func (c Client) Render(pkgPath string, args string) (string, *ctypes.ResultABCIQ
if err != nil {
return "", nil, errors.Wrap(err, "query render")
}
if qres.Response.Error != nil {
return "", nil, errors.Wrap(qres.Response.Error, "Render failed: log:%s", qres.Response.Log)
}

return string(qres.Response.Data), qres, nil
}
Expand All @@ -113,6 +116,9 @@ func (c Client) QEval(pkgPath string, expression string) (string, *ctypes.Result
if err != nil {
return "", nil, errors.Wrap(err, "query qeval")
}
if qres.Response.Error != nil {
return "", nil, errors.Wrap(qres.Response.Error, "QEval failed: log:%s", qres.Response.Log)
}

return string(qres.Response.Data), qres, nil
}

0 comments on commit f1059c7

Please sign in to comment.