Skip to content

Commit

Permalink
fix: raise for JSONDecodeError
Browse files Browse the repository at this point in the history
  • Loading branch information
BobTheBuidler committed Sep 6, 2023
1 parent d5b92bb commit 9c2133d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/curve_apy_previews.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ def _build_data(gauges):
apy = await_awaitable(calculate_simple(None, gauge, samples))
else:
apy = Apy("zero_weight", 0, 0, ApyFees(0, 0), ApyPoints(0, 0, 0))
except json.JSONDecodeError:
raise
except Exception as error:
apy_error.error_reason = ":".join(str(arg) for arg in error.args)
logger.error(error)
Expand Down
2 changes: 2 additions & 0 deletions scripts/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ async def get_apy(vault, samples) -> Apy:
try:
return await vault.apy(samples)
except (ValueError, yPriceMagicError) as error:
if isinstance(error, yPriceMagicError) and isinstance(error.exception, json.JSONDecodeError):
raise error
logger.error(error)
return Apy(
type="error",
Expand Down

0 comments on commit 9c2133d

Please sign in to comment.