Source code for terselib.exceptions

"""Exception hierarchy for :mod:`terselib`."""


[docs] class TerseError(Exception): """Base class for all TerseLib errors."""
[docs] class TerseFormatError(TerseError): """The input is not a valid TERSE file (bad header, bad validation bytes, inconsistent record lengths, ...)."""
[docs] class TerseCorruptError(TerseError): """The compressed payload is structurally invalid (truncated code, impossible dictionary reference, expansion-stack overflow, ...)."""
[docs] class TerseParameterError(TerseError): """Invalid or inconsistent parameters were passed to a compression or decompression call (e.g. an unknown method or code page)."""