Skip to content

Commit

Permalink
fix: check for upstream proxy message (#630)
Browse files Browse the repository at this point in the history
  • Loading branch information
crebsy authored Sep 22, 2023
1 parent 518588e commit e94fc03
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions yearn/apy/curve/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,13 @@ def get_gauge_relative_weight_for_sidechain(gauge_address):
try:
result = res.json()
except json.JSONDecodeError:
error_message = res.text
if "cf-footer" in error_message:
error_message = "node temporarily unavailable"
try:
raise ApyError("crv:simple", f"mainnet rpc returned bad response {HTTPStatus(res.status_code)} {res.text}")
raise ApyError("crv:simple", f"mainnet rpc returned bad response {HTTPStatus(res.status_code)} {error_message}")
except ValueError:
raise ApyError("crv:simple", f"mainnet rpc returned bad response code {res.status_code} {res.text}")
raise ApyError("crv:simple", f"mainnet rpc returned bad response code {res.status_code} {error_message}")
return int(result["result"], 16)


Expand Down

0 comments on commit e94fc03

Please sign in to comment.