Source code for mugatu.exceptions

# !usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under a 3-clause BSD license.
#
# @Author: Brian Cherinka
# @Date:   2017-12-05 12:01:21
# @Last modified by:   Brian Cherinka
# @Last Modified time: 2017-12-05 12:19:32

from __future__ import print_function, division, absolute_import


[docs] class MugatuError(Exception): """A custom core Mugatu exception""" def __init__(self, message=None): message = 'There has been an error' \ if not message else message super(MugatuError, self).__init__(message)
[docs] class MugatuNotImplemented(MugatuError): """A custom exception for not yet implemented features.""" def __init__(self, message=None): message = 'This feature is not implemented yet.' \ if not message else message super(MugatuNotImplemented, self).__init__(message)
[docs] class MugatuDesignError(MugatuError): """A custom exception when there is a critial error in a design.""" def __init__(self, message=None): message = 'There is a critical error in the design.' \ if not message else message super(MugatuDesignError, self).__init__(message)
[docs] class MugatuAPIError(MugatuError): """A custom exception for API errors""" def __init__(self, message=None): if not message: message = 'Error with Http Response from Mugatu API' else: message = 'Http response error from Mugatu API. {0}'.format(message) super(MugatuAPIError, self).__init__(message)
[docs] class MugatuApiAuthError(MugatuAPIError): """A custom exception for API authentication errors""" pass
[docs] class MugatuMissingDependency(MugatuError): """A custom exception for missing dependencies.""" pass
[docs] class MugatuWarning(Warning): """Base warning for Mugatu."""
[docs] class MugatuUserWarning(UserWarning, MugatuWarning): """The primary warning class.""" pass
[docs] class MugatuSkippedTestWarning(MugatuUserWarning): """A warning for when a test is skipped.""" pass
[docs] class MugatuDesignWarning(MugatuUserWarning): """A warning for when a test is skipped.""" pass
[docs] class MugatuDesignModeWarning(MugatuUserWarning): """A warning for when a test is skipped.""" pass
[docs] class MugatuDeprecationWarning(MugatuUserWarning): """A warning for deprecated features.""" pass