-
Notifications
You must be signed in to change notification settings - Fork 0
/
Errors.py
38 lines (31 loc) · 824 Bytes
/
Errors.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Author Geoff Miller
# Date: 12-26-15
# Currency Problem
from enum import IntEnum
class ErrorCodes(IntEnum):
"""
Stores the integer error codes. Use ErrorMessage for human code messages
"""
R_SUCCESS = 0
E_FAILURE = 1
E_USER_EXIT = 2
E_UNEXPECTED_TERMINATION = 3
E_ZERO = 4
class ErrorMessages:
"""
Stores the human readable error messages
"""
errors = [
"General success",
"General failure",
"User initiated exit",
"An error has caused the program to exit",
"Zero is not a valid value for currency value!"
]
@classmethod
def verbose(cls, num):
"""For returning the verbose, human-readable error code
:param num: the error code number
:return:
"""
return str(cls.errors[num])