pyceo/ceo_common/errors.py

52 lines
1.1 KiB
Python
Raw Normal View History

2021-07-24 21:09:10 +00:00
class UserNotFoundError(Exception):
2021-08-03 23:19:33 +00:00
def __init__(self):
super().__init__('user not found')
2021-07-24 21:09:10 +00:00
class GroupNotFoundError(Exception):
2021-08-03 23:19:33 +00:00
def __init__(self):
super().__init__('group not found')
2021-08-02 08:01:13 +00:00
class BadRequest(Exception):
pass
2021-08-03 20:11:13 +00:00
2021-08-18 01:59:24 +00:00
class KerberosError(Exception):
pass
2021-08-03 23:19:33 +00:00
class UserAlreadyExistsError(Exception):
def __init__(self):
super().__init__('user already exists')
class GroupAlreadyExistsError(Exception):
def __init__(self):
super().__init__('group already exists')
2021-08-18 23:48:17 +00:00
class UserAlreadyInGroupError(Exception):
def __init__(self):
super().__init__('user is already in group')
class UserNotInGroupError(Exception):
def __init__(self):
super().__init__('user is not in group')
2021-08-03 20:11:13 +00:00
class UserAlreadySubscribedError(Exception):
2021-08-03 23:19:33 +00:00
def __init__(self):
super().__init__('user is already subscribed')
2021-08-03 20:11:13 +00:00
class UserNotSubscribedError(Exception):
2021-08-03 23:19:33 +00:00
def __init__(self):
super().__init__('user is not subscribed')
class NoSuchListError(Exception):
def __init__(self):
super().__init__('mailing list does not exist')