Source code for dtfabric.errors

# -*- coding: utf-8 -*-
"""The error objects."""


[docs]class Error(Exception): """The error interface."""
[docs]class ByteStreamTooSmallError(Error): """Error that is raised when the byte stream is too small."""
[docs]class DefinitionReaderError(Error): """Error that is raised by the definition reader. Attributes: name (str): name of the definition. message (str): error message. """ def __init__(self, name: str, message: str) -> None: """Initializes an error. Args: name (str): name of the definition. message (str): error message. """ # pylint: disable=super-init-not-called # Do not call initialize of the super class. self.name: str = name self.message: str = message
[docs]class FoldingError(Error): """Error that is raised when the definition cannot be folded."""
[docs]class FormatError(Error): """Error that is raised when the definition format is incorrect."""
[docs]class MappingError(Error): """Error that is raised when the definition cannot be mapped."""