Skip to content

Commit

Permalink
fix: None handling
Browse files Browse the repository at this point in the history
  • Loading branch information
BobTheBuidler authored Aug 30, 2023
1 parent a847571 commit 947cef0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion y/prices/utils/ypriceapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ async def get_price(
return None
session = await get_session()
async with session.get(f'/get_price/{chain.id}/{token}?block={block}') as response:
return UsdPrice(await read_response(response, token, block))
if price := await read_response(response, token, block):
return UsdPrice(price)
except asyncio.TimeoutError:
logger.warning(f'ypriceAPI timed out for {token} at {block}.{FALLBACK_STR}')
except ContentTypeError:
Expand Down

0 comments on commit 947cef0

Please sign in to comment.