1
|
|
|
class BotError(Exception): |
2
|
|
|
"""A custom exception class to wrap bot errors.""" |
3
|
|
|
pass |
4
|
|
|
|
5
|
|
|
|
6
|
|
|
class DrinkError(BotError): |
7
|
|
|
"""An Base Exception for Drinks Errors.""" |
8
|
|
|
|
9
|
|
|
def __init__(self, drink_name: str): |
10
|
|
|
self.drink_name = drink_name |
11
|
|
|
|
12
|
|
|
|
13
|
|
|
class DrinkAlreadyExists(DrinkError): |
14
|
|
|
"""Raised when a drink is already in the database.""" |
15
|
|
|
pass |
16
|
|
|
|
17
|
|
|
|
18
|
|
|
class DrinkNotFound(DrinkError): |
19
|
|
|
"""Raised when a drink isn't found in the database.""" |
20
|
|
|
pass |
21
|
|
|
|
22
|
|
|
|
23
|
|
|
class MemberError(BotError): |
24
|
|
|
"""An Base Exception for Member Errors.""" |
25
|
|
|
|
26
|
|
|
def __init__(self, member_name: str, member_type: str): |
27
|
|
|
self.member_name = member_name |
28
|
|
|
self.member_type = member_type |
29
|
|
|
|
30
|
|
|
|
31
|
|
|
class MemberAlreadyExists(MemberError): |
32
|
|
|
"""Raised when a member with the given name already exists in database.""" |
33
|
|
|
pass |
34
|
|
|
|
35
|
|
|
|
36
|
|
|
class MemberNotFound(MemberError): |
37
|
|
|
"""Raised when a member with the given isn't found within the database.""" |
38
|
|
|
pass |
39
|
|
|
|
40
|
|
|
|
41
|
|
|
class EmployeeError(BotError): |
42
|
|
|
"""An Base Exception for Worker Errors.""" |
43
|
|
|
|
44
|
|
|
def __init__(self, employee_name: str): |
45
|
|
|
self.employee_name = employee_name |
46
|
|
|
|
47
|
|
|
|
48
|
|
|
class EmployeeFound(EmployeeError): |
49
|
|
|
"""Raised when a worker is already working.""" |
50
|
|
|
pass |
51
|
|
|
|
52
|
|
|
|
53
|
|
|
class EmployeeNotFound(EmployeeError): |
54
|
|
|
"""Raised when a worker is not yet working.""" |
55
|
|
|
pass |
56
|
|
|
|