You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When querying the endpoint cosmos/staking/v1beta1/delegations/${address} it throws an error with code 500 if there are no delegations for the address, which leads to unnecessary error catching on client-side applications.
Rather, I would expect a response 200 with an empty array such as what is provided in the cosmos/staking/v1beta1/delegators/${address}/unbonding_delegations endpoint, or a 404.
Version
gaia 4.1.0
cosmos-sdk 0.42.1
Steps to Reproduce
# new address
gaiad keys add testing
# 200 response with empty array in response
curl -s -w "\nstatus: %{http_code}" https://cosmos.sg-1.online/cosmos/staking/v1beta1/delegators/$(gaiad keys show testing -a)/unbonding_delegations
# 500 response with error
curl -s -w "\nstatus: %{http_code}" https://cosmos.sg-1.online/cosmos/staking/v1beta1/delegations/$(gaiad keys show testing -a)
For Admin Use
Not duplicate issue
Appropriate labels applied
Appropriate contributors tagged
Contributor assigned/self-assigned
The text was updated successfully, but these errors were encountered:
"unable to find delegations for address %s", req.DelegatorAddr)
}
My guess is this might be a gRPC-gateway error: codes.NotFound is translated into a 500 instead of a 404. @aleem1314 or @atheeshp do you know about this?
Summary of Bug
When querying the endpoint
cosmos/staking/v1beta1/delegations/${address}
it throws an error with code500
if there are no delegations for the address, which leads to unnecessary error catching on client-side applications.Rather, I would expect a response
200
with an empty array such as what is provided in thecosmos/staking/v1beta1/delegators/${address}/unbonding_delegations
endpoint, or a404
.Version
gaia 4.1.0
cosmos-sdk 0.42.1
Steps to Reproduce
For Admin Use
The text was updated successfully, but these errors were encountered: