Skip to content

Commit

Permalink
maybe_download: use RequestException that includes connection err…
Browse files Browse the repository at this point in the history
…ors, timeouts, ssl errors, not only http errors
  • Loading branch information
deeenes committed Sep 15, 2023
1 parent 11a0e3c commit 0b2f96f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions omnipath/_core/downloader/_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
import logging
import traceback

from requests import Request, Session, HTTPError, PreparedRequest
from requests import Request, Session, PreparedRequest
from tqdm.auto import tqdm
from urllib3.util import Retry
from requests.adapters import HTTPAdapter
from requests.exceptions import RequestException

from omnipath._core.utils._options import Options
from omnipath.constants._pkg_constants import (
Expand Down Expand Up @@ -140,7 +141,7 @@ def maybe_download(
else:
try:
res = self._download(req)
except HTTPError:
except RequestException:
logging.warn(f"Failed to download from `{domain}`.")
logging.warn(traceback.format_exc())
continue
Expand Down

0 comments on commit 0b2f96f

Please sign in to comment.