Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catching more exceptions in web retry #916

Merged
merged 1 commit into from
Jun 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions tidy3d/web/webapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
from typing import List, Dict, Callable
from functools import wraps

from requests import HTTPError
from requests import HTTPError, ReadTimeout
from requests.exceptions import ConnectionError as ConnErr
from requests.exceptions import JSONDecodeError
from urllib3.exceptions import NewConnectionError

import pytz
Expand Down Expand Up @@ -52,7 +53,7 @@ def web_fn_wrapped(*args, **kwargs):
while (time.time() - time_start) < wait_time_sec:
try:
return web_fn(*args, **kwargs)
except (ConnErr, ConnectionError, NewConnectionError):
except (ConnErr, ConnectionError, NewConnectionError, ReadTimeout, JSONDecodeError):
if not warned_previously:
log.warning(f"No connection: Retrying for {wait_time_sec} seconds.")
warned_previously = True
Expand Down