forked from ChelseaKR/id-churn-sentinel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.py
More file actions
42 lines (27 loc) · 1.36 KB
/
Copy patherrors.py
File metadata and controls
42 lines (27 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"""The error taxonomy. One base class, so a caller can catch everything this tool raises."""
from __future__ import annotations
__all__ = [
"PublishError",
"RegistryError",
"ReviewError",
"SentinelError",
"StoreError",
"VerificationError",
]
class SentinelError(Exception):
"""Base class for every error raised by this package."""
class RegistryError(SentinelError):
"""The committed source registry is malformed, or an entry violates a registry rule."""
class StoreError(SentinelError):
"""The snapshot/change store was asked for something it cannot do."""
class ReviewError(SentinelError):
"""A review action was rejected — most often, a classification without a human reviewer."""
class VerificationError(SentinelError):
"""A source verification was refused — most often, a confirmation with no named verifier.
Same shape as `ReviewError`, and for the same reason: `verified: true` is a claim that a
*person* opened a government page and confirmed it is the right one. An anonymous
verification is indistinguishable from a machine's, and the machine's opinion is exactly
what this field exists to not be."""
class PublishError(SentinelError):
"""Publication was refused. The only reason this exists: an unreviewed record reached
the feed writer. That is a bug, and it must be loud rather than published."""