Files
deb-python-dcos/dcos/errors.py
Michael Gummelt 0dc16e7d93 exceptions
2015-05-06 11:11:15 -07:00

34 lines
600 B
Python

import abc
class DCOSException(Exception):
pass
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