Files
deb-python-dcos/dcos/errors.py
José Armando García Sancio 5a340cba96 Move modules from dcos.api to dcos
2015-04-29 22:32:54 -07:00

30 lines
557 B
Python

import abc
class Error(object):
"""Abstract class for describing errors."""
@abc.abstractmethod
def error(self):
"""Creates an error message
:returns: The error message
:rtype: str
"""
raise NotImplementedError
class DefaultError(Error):
"""Construct a basic Error class based on a string
:param message: String to use for the error message
:type message: str
"""
def __init__(self, message):
self._message = message
def error(self):
return self._message