Skip to content

errors

ExpressionMismatchError(operation='', ltype=None, rtype=None)

Bases: Exception

Expression mismatch during the operation

Source code in geomech/utils/errors.py
4
5
6
7
8
9
def __init__(self, operation="", ltype=None, rtype=None):
    if ltype is not None and rtype is not None:
        msg = operation + " cannot be performed between " + ltype.name + " and " + rtype.name
    else:
        msg = "operation cannot be performed"
    super().__init__(msg)

SizeMismatchError(operation='', expected=None, got=None)

Bases: Exception

Operand sizes do not match for the operation.

Source code in geomech/utils/errors.py
def __init__(self, operation="", expected=None, got=None):
    if expected is not None and got is not None:
        msg = operation + " size mismatch: expected " + str(expected) + ", got " + str(got)
    else:
        msg = operation + " operand sizes do not match"
    super().__init__(msg)

UndefinedCaseError()

Bases: Exception

New case found

Source code in geomech/utils/errors.py
def __init__(self):
    # TODO add operation and message types
    msg = "New (undefined) case has been found"
    super().__init__(msg)