New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unmarshalling error on withdraw-all-rewards #3900
Comments
Ah I understand now the node I was connecting to is down and returning a 400 error. The |
HTML? Where is the HTML coming from? It should only be JSON that is returned from the queriers. |
because the host i was using is down it returns a 400 error in the form of an html website to display the 400 error |
@okwme I don't quite understand the problem here. |
so i was using a bad endpoint as my node. because it was a bad endpoint, the requests it received were responded to with html instead of json. this is obv my fault, but the point i meant was that there is no error handling on the SDK for when the document received is not a json doc. i'm suggesting a new error handler, that checked the doc type from the response header and threw an error that said something like, "wrong doc type received" instead of trying to parse the html as json (which produces the error i pasted above). |
As you mentioned we just need to return a proper error for the bad connection |
Yeah looks like we're not returning an error gracefully when parsing the response. I don't think we should be checking for headers and content-type. |
I got
Did you mean the point you connected was NOT cosmos node ? |
correct @yangyanqing I was connecting to a cosmos node that was offline. The response was not in the expected format but the SDK did not handle this un-expected response with a very descriptive error. I was suggesting maybe to make a new error that checks the response for correct format? |
closing this issue as error handling has changed quite a bit since this was opened. If the error still persists please open a new issue |
Summary of Bug
trying to run command
gaiacli tx distr withdraw-all-rewards --from $MY_ADDR
but getting this error:Same thing happens when I run it without the
--from
flag.Steps to Reproduce
Be me, delegate, try to withdraw-all-rewards. When run with
--trace
i get this:For Admin Use
The text was updated successfully, but these errors were encountered: