Skip to content

Commit 525a0eb

Browse files
committed
Make FetcherHTTPError a DownloadError
Make FetcherHTTPError a DownloadError as the error itself denotes an error happening during the download process. Signed-off-by: Martin Vrachev <[email protected]>
1 parent 6e91858 commit 525a0eb

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

tuf/api/exceptions.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,6 @@ class LengthOrHashMismatchError(Exception):
1919
"""An error while checking the length and hash values of an object."""
2020

2121

22-
class FetcherHTTPError(Exception):
23-
"""
24-
Returned by FetcherInterface implementations for HTTP errors.
25-
26-
Args:
27-
message: The HTTP error messsage
28-
status_code: The HTTP status code
29-
"""
30-
31-
def __init__(self, message: str, status_code: int):
32-
super().__init__(message)
33-
self.status_code = status_code
34-
35-
3622
class URLParsingError(Exception):
3723
"""If we are unable to parse a URL -- for example, if a hostname element
3824
cannot be isoalted."""
@@ -97,3 +83,17 @@ class DownloadLengthMismatchError(DownloadError):
9783

9884
class SlowRetrievalError(DownloadError):
9985
"""Indicate that downloading a file took an unreasonably long time."""
86+
87+
88+
class FetcherHTTPError(DownloadError):
89+
"""
90+
Returned by FetcherInterface implementations for HTTP errors.
91+
92+
Args:
93+
message: The HTTP error messsage
94+
status_code: The HTTP status code
95+
"""
96+
97+
def __init__(self, message: str, status_code: int):
98+
super().__init__(message)
99+
self.status_code = status_code

0 commit comments

Comments
 (0)