-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patherrors.py
More file actions
46 lines (29 loc) · 1.46 KB
/
Copy patherrors.py
File metadata and controls
46 lines (29 loc) · 1.46 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
43
44
45
46
#!/usr/bin/env python3
"""
Custom errors for Dissemination Service
"""
class DisseminationError(Exception):
"""Exception to report generic errors"""
def __init__(self, message):
super().__init__(message)
class InternetArchiveIdentifierCollisionError(DisseminationError):
"""Refuse to modify an Internet Archive item not known to belong to Thoth."""
class InternetArchiveRestrictedMetadataError(DisseminationError):
"""Refuse to mutate Archive metadata unavailable to normal credentials."""
class InternetArchiveImmutableMetadataError(
InternetArchiveRestrictedMetadataError):
"""Refuse to mutate an item with incompatible initial-only metadata."""
class InternetArchiveVerificationError(DisseminationError):
"""Report an Internet Archive upload which could not be verified in time."""
class InternetArchiveConsistencyError(DisseminationError):
"""Report an Archive item that changed inconsistently mid-reconciliation.
Raised when a target item that passed an earlier stage of a multi-stage
reconciliation (for example the PDF/metadata verification that precedes the
deferred JSON sidecar upload) has since disappeared. The item is never
recreated from the later stage.
"""
class InternetArchiveDesiredStateError(DisseminationError):
"""Report which source failed while constructing Archive desired state."""
def __init__(self, source, message):
self.source = source
super().__init__(message)