Skip to content

Commit

Permalink
ngclient: Small refactor, avoid isinstance
Browse files Browse the repository at this point in the history
Signed-off-by: Jussi Kukkonen <[email protected]>
  • Loading branch information
Jussi Kukkonen committed Feb 3, 2022
1 parent 2ca3be8 commit bb58178
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tuf/ngclient/fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ def fetch(self, url: str) -> Iterator[bytes]:
# fetcher implementation
try:
return self._fetch(url)
except exceptions.DownloadError as e:
raise e
except Exception as e:
if isinstance(e, exceptions.DownloadError):
raise e
raise exceptions.DownloadError(f"Failed to download {url}") from e

@contextmanager
Expand Down

0 comments on commit bb58178

Please sign in to comment.