"""
Here are defined all possible application type errors.
They are defined to show more info to the user/developer,
and to catch errors that hides from developers.
"""
import os
[docs]class model(Exception):
"""Exception type for model error.
Args:
message (str): Message for error info.
Attributes:
message (str): Message for error info.
exitCode (int): Exit code.
"""
def __init__(self, message):
self.message = message
self.exitCode = os.EX_DATAERR
[docs] def __str__(self):
"""
Return:
Error message.
"""
return repr(self.message)
[docs]class user(Exception):
"""Exception type for user error.
Args:
message (str): Message for error info.
Attributes:
message (str): Message for error info.
exitCode (int): Exit code.
"""
def __init__(self, message):
self.message = message
self.exitCode = os.EX_USAGE
[docs] def __str__(self):
"""
Return:
Error message.
"""
return repr(self.message)
[docs]class developer(Exception):
"""Exception type for developer error.
Args:
message (str): Message for error info.
Attributes:
message (str): Message for error info.
exitCode (int): Exit code.
"""
def __init__(self, message):
self.message = message
self.exitCode = os.EX_SOFTWARE
[docs] def __str__(self):
"""
Return:
Error message.
"""
return repr(self.message)