Files
thor/thor/clients/__init__.py
T

15 lines
623 B
Python
Raw Normal View History

"""Read-only clients for the sources Thor watches through, plus the Tinker ticket client.
Every client raises :class:`SourceError` when its source can't answer. Callers must treat
that as "unknown" (Thor is blind to that source), never as "nothing found" (thor#1,
Area 1 rule 3; same principle as Gandalf's ``reboots.LokiError``).
"""
class SourceError(Exception):
"""A source could not answer: unreachable, timed out, HTTP error or a malformed reply."""
def __init__(self, source: str, message: str):
super().__init__(f'{source}: {message}')
self.source = source
self.message = message