Source code for rics.translation.fetching.exceptions

"""Translation-specific exceptions."""


[docs]class FetcherError(RuntimeError): """Base class for fetcher exceptions."""
[docs]class ForbiddenOperationError(FetcherError): """Exception indicating that the fetcher does not support an operation. Args: operation: The operation which was not supported. """ def __init__(self, operation: str, reason: str = "not supported by this fetcher.") -> None: super().__init__(f"Operation '{operation}' " + reason) self.operation = operation
[docs]class ImplementationError(FetcherError): """An underlying implementation did something wrong."""
[docs]class UnknownPlaceholderError(FetcherError): """Caller requested unknown placeholder name(s)."""
[docs]class UnknownIdError(FetcherError): """Caller requested unknown id(s)."""
[docs]class UnknownSourceError(FetcherError): """Caller requested unknown source(s)."""