29 lines
654 B
Python
29 lines
654 B
Python
from enum import Enum
|
|
|
|
|
|
class ErrorCodes(Enum):
|
|
StartFailed = 'Start failed'
|
|
FileNotFound = 'File not found'
|
|
WrongFileType = 'Wrong file type'
|
|
|
|
Unknown = 'Unknown {}'
|
|
Inaccessible = '{} inaccessible'
|
|
Unexpected = 'Unexpected {}'
|
|
Expected = 'Expected {}'
|
|
|
|
LibInLib = 'Lib in lib'
|
|
LibInClass = 'Lib in class'
|
|
LibInFunc = 'Lib in func'
|
|
ClassInClass = 'Class in class'
|
|
ClassInFunc = 'Class in func'
|
|
FuncInLib = 'Func in lib'
|
|
FuncInFunc = 'Func in func'
|
|
|
|
|
|
class Error:
|
|
|
|
def __init__(self, code: ErrorCodes, msg: str = '') -> None:
|
|
self.code = code
|
|
|
|
self.msg = code.value.format(msg)
|