the content of error was being set from last received response from sharder. for example, below shows the added error was from good response. the next example is able to show error correctly
allocation_fetch_error: Error fetching the allocation.internal_error: can't get allocation: error retrieving allocation: 47e4250e012b40d914aea81be8b5bbfcd0befb98463a5b2b9ff761bb7ea762af, error: failed to connect to host=helm-sharder-postgres-02 user=zchain_user database=events_db: server error (FATAL: remaining connection slots are reserved for non-replication superuser connections (SQLSTATE 53300))
This seems to be an issue as well for when dominant response is 200 but the last response received from sharder is from a non-200. The non-200 response (error) will be used as the 200 response.
response body not returned as error when dominant sharder response is not 200.
https://github.com/0chain/gosdk/blob/70a96ae85bff57245604f5ff6cd7e262519074f4/zboxcore/zboxutil/http.go#L570
the content of error was being set from last received response from sharder. for example, below shows the added error was from good response. the next example is able to show error correctly
with good response as error
with actual error