Skip to content

Commit

Permalink
Merge pull request gnolang#19 from jefft0/fix/gnoclient-Render-QEval-…
Browse files Browse the repository at this point in the history
…errors

fix: In gnoclient Render and QEval, need to check Response.Error
  • Loading branch information
moul authored Nov 30, 2023
2 parents 89f112c + f1059c7 commit 902c95b
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 902c95b

Please sign in to comment.