24 lines
478 B
Python
24 lines
478 B
Python
class Error(Exception):
|
|
def __init__(self, value=""):
|
|
if not hasattr(self, "value"):
|
|
self.value = value
|
|
|
|
def __str__(self):
|
|
return repr(self.value)
|
|
|
|
|
|
class InvalidSma(Error):
|
|
message = "Invalid SMA period."
|
|
|
|
|
|
class ResourceNotFound(Error):
|
|
message = "Resource not found."
|
|
|
|
|
|
class DateFormatError(Error):
|
|
message = "Error with date parameters."
|
|
|
|
|
|
class Messages:
|
|
INTERNAL_SERVER_ERROR = "Server error. please try again later."
|