Skip to content

Commit 6b53ac7

Browse files
author
Jussi Kukkonen
committed
Make BadHashError derive from RepositoryError
This is backwards-compatible and means that most (all?) errors resulting from suspicious or broken metadata are now RepositoryErrors. Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
1 parent a371258 commit 6b53ac7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tuf/exceptions.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ class UnsupportedAlgorithmError(Error):
6666
"""Indicate an error while trying to identify a user-specified algorithm."""
6767

6868

69-
class BadHashError(Error):
69+
class RepositoryError(Error):
70+
"""Indicate an error with a repository's state, such as a missing file."""
71+
72+
73+
class BadHashError(RepositoryError):
7074
"""Indicate an error while checking the value of a hash object."""
7175

7276
def __init__(self, expected_hash, observed_hash):
@@ -97,10 +101,6 @@ class UnknownKeyError(Error):
97101
"""Indicate an error while verifying key-like objects (e.g., keyids)."""
98102

99103

100-
class RepositoryError(Error):
101-
"""Indicate an error with a repository's state, such as a missing file."""
102-
103-
104104
class BadVersionNumberError(RepositoryError):
105105
"""Indicate an error for metadata that contains an invalid version number."""
106106

0 commit comments

Comments
 (0)