Source code for rics.translation.dio.exceptions

"""Data structure I  exceptions."""

from typing import Any, Type


[docs]class DataStructureIOError(RuntimeError): """Base class for IO exceptions."""
[docs]class UntranslatableTypeError(DataStructureIOError): """Exception indicating that a type cannot be translated. Args: t: A type. """ def __init__(self, t: Type[Any]) -> None: super().__init__(f"Type {t} cannot be translated.")
[docs]class NotInplaceTranslatableError(DataStructureIOError): """Exception indicating that a type cannot be translated in-place. Args: arg: Something that can't be translated inplace. """ def __init__(self, arg: Any) -> None: super().__init__(f"Inplace translation not possible or implemented for type: {type(arg)}")