diff options
Diffstat (limited to 'moonv4/moon_utilities/moon_utilities/exceptions.py')
-rw-r--r-- | moonv4/moon_utilities/moon_utilities/exceptions.py | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/moonv4/moon_utilities/moon_utilities/exceptions.py b/moonv4/moon_utilities/moon_utilities/exceptions.py index f642fb57..ba5ecf46 100644 --- a/moonv4/moon_utilities/moon_utilities/exceptions.py +++ b/moonv4/moon_utilities/moon_utilities/exceptions.py @@ -5,7 +5,7 @@ from oslo_log import log as logging from werkzeug.exceptions import HTTPException -LOG = logging.getLogger(__name__) +LOG = logging.getLogger("moon.utilities.exceptions") _ = str @@ -475,6 +475,9 @@ class RuleUnknown(AdminRule): logger = "ERROR" +# Keystone exceptions + + class KeystoneError(MoonError): description = _("There is an error connecting to Keystone.") code = 400 @@ -503,3 +506,36 @@ class KeystoneUserConflict(KeystoneUserError): logger = "ERROR" +# Consul exceptions + + +class ConsulError(MoonError): + description = _("There is an error connecting to Consul.") + code = 400 + title = 'Consul error' + logger = "ERROR" + + +class ConsulComponentNotFound(ConsulError): + description = _("The component do not exist in Consul database.") + code = 500 + title = 'Consul error' + logger = "WARNING" + + +# Containers exceptions + + +class DockerError(MoonError): + description = _("There is an error with Docker.") + code = 400 + title = 'Docker error' + logger = "ERROR" + + +class ContainerMissing(DockerError): + description = _("Some containers are missing.") + code = 400 + title = 'Container missing' + logger = "ERROR" + |