Source code for id_translation.exceptions

"""General errors for the translation suite."""

from warnings import simplefilter as _simplefilter


[docs] class ConfigurationError(TypeError): """Raised in case of bad configuration."""
[docs] class ConfigurationChangedError(Exception): """See :meth:`.Translator.load_persistent_instance`."""
[docs] class ConnectionStatusError(ConnectionError): """Raised when trying to perform operations in a bad online/offline state."""
[docs] class TranslationError(Exception): """Base class for translation errors."""
[docs] class MissingNamesError(TranslationError): """Raised if names could not be derived based on the data type, and aren't explicitly given."""
[docs] class TooManyFailedTranslationsError(TranslationError): """Raised if too many IDs fail to translate."""
[docs] class TranslationWarning(UserWarning): """Base class for translation warnings."""
[docs] class TranslationDisabledWarning(TranslationWarning): """Translation is globally disabled."""
_simplefilter("once", category=TranslationDisabledWarning)