2021-07-27 09:41:51 +02:00
|
|
|
from enum import Enum
|
|
|
|
|
|
|
|
|
|
|
|
# models
|
|
|
|
class ExceptionArgument(Enum):
|
|
|
|
list = 'list'
|
|
|
|
func = 'func'
|
|
|
|
type = 'type'
|
2021-07-27 10:59:24 +02:00
|
|
|
value = 'value'
|
2021-07-27 11:29:52 +02:00
|
|
|
index = 'index'
|
2021-07-27 09:41:51 +02:00
|
|
|
|
|
|
|
|
|
|
|
# exceptions
|
|
|
|
class ArgumentNoneException(Exception):
|
|
|
|
|
|
|
|
def __init__(self, arg: ExceptionArgument):
|
2021-07-27 11:40:24 +02:00
|
|
|
Exception.__init__(self, f'argument {arg} is None')
|
|
|
|
|
|
|
|
|
|
|
|
class IndexOutOfRangeException(Exception):
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
Exception.__init__(self, f'List index out of range')
|
2021-07-27 09:41:51 +02:00
|
|
|
|
|
|
|
|
2021-07-27 09:26:30 +02:00
|
|
|
class InvalidTypeException(Exception):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class WrongTypeException(Exception):
|
|
|
|
pass
|