msgpack decode masks http error
barnjamin opened this issue · comments
Subject of the issue
When calling something like client.Block(round).Do...
, if there is an HTTP error, JSON is returned but we don't check status code and try to msgpack decode the result anyway.
This leads to the error seeming like its one with formatting and the real error is masked.
We should check the http status code here and return an error that wraps the resulting error message
go-algorand-sdk/client/v2/common/common.go
Line 220 in 7285700
What is the exact error being encountered and steps to reproduce?
I see the exact same issue - ie passing a block that doesn't exist will reproduce this. The node returns a 500 (instead of a 404 for some reason) and it comes back as a msgpack decode error.