Skip to content

Commit

Permalink
fix: SSLError (#615)
Browse files Browse the repository at this point in the history
  • Loading branch information
BobTheBuidler authored Sep 9, 2023
1 parent de5458f commit 4f8dc67
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion yearn/special.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ async def apy(self, _: ApySamples) -> Apy:

@eth_retry.auto_retry
async def tvl(self, block=None) -> Tvl:
data = requests.get("https://api.pickle.finance/prod/protocol/value").json()
try:
data = requests.get("https://api.pickle.finance/prod/protocol/value").json()
except requests.exceptions.SSLError as e:
return Tvl(tvl=None)
tvl = data[self.id]
return Tvl(tvl=tvl)

Expand Down

0 comments on commit 4f8dc67

Please sign in to comment.