Skip to content

Commit

Permalink
catching all exceptions for swap
Browse files Browse the repository at this point in the history
  • Loading branch information
nerfZael committed Jun 28, 2024
1 parent 7649dce commit e95d49d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions autotx/utils/ethereum/lifi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ async def get_quote_to_amount(
while True:
try:
return await handle_lifi_response(await http_requests.post(cls.BASE_URL + "/quote/contractCalls", json=params, headers=headers))
except LifiApiError as e:
except Exception as e:
if "No available quotes for the requested transfer" in str(e) or "Unable to find quote to match expected output" in str(e):
if attempt_count < 5:
attempt_count += 1
Expand Down Expand Up @@ -107,8 +107,8 @@ async def get_quote_from_amount(
attempt_count = 0
while True:
try:
return await handle_lifi_response( await http_requests.get(cls.BASE_URL + "/quote", params=params, headers=headers))
except LifiApiError as e:
return await handle_lifi_response(await http_requests.get(cls.BASE_URL + "/quote", params=params, headers=headers))
except Exception as e:
if "No available quotes for the requested transfer" in str(e) or "Unable to find quote to match expected output" in str(e):
if attempt_count < 5:
attempt_count += 1
Expand Down

0 comments on commit e95d49d

Please sign in to comment.