Source code for app.domain.helpers.exceptions

"""Module with classes that inherit from Python's builtin Exception class
and represent domain specific errors."""


[docs]class MatlabEngineContainerError(Exception): """Raised an AttributeError or EngineError is found in matlab container modules."""
[docs] def __init__(self, value=""): self.value = value
def __str__(self): return self.value
[docs]class DistributionShapeError(Exception): """Raised when a vector shape is expected to match a matrix's column or row shape and does not."""
[docs] def __init__(self, value=""): self.value = value
def __str__(self): return self.value
[docs]class MatrixNotSquareError(Exception): """Raised when a function expects a square (N * N) matrix in any representation and some other dimensions are given."""
[docs] def __init__(self, value=""): self.value = value
def __str__(self): return self.value
[docs]class MatrixError(Exception): """Generic Matrix Error, can be used for example when a pandas DataFrame has shape (0, 0) or is one-dimensional."""
[docs] def __init__(self, value=""): self.value = value
def __str__(self): return self.value
[docs]class IllegalArgumentError(ValueError): """Generic error used to indicate a parameter is not valid or expected."""
[docs] def __init__(self, value=""): super().__init__(value)