ansible-doctor/ansibledoctor/exception.py

27 lines
553 B
Python
Raw Permalink Normal View History

2019-10-08 09:30:31 +00:00
#!/usr/bin/env python3
"""Doctor exception module."""
2019-10-08 09:30:31 +00:00
class DoctorError(Exception):
"""Define generic exception."""
2019-10-08 09:30:31 +00:00
def __init__(self, msg, original_exception=""):
super().__init__(f"{msg}\n{original_exception}")
2019-10-08 09:30:31 +00:00
self.original_exception = original_exception
class YAMLError(DoctorError):
"""Errors while reading a yaml file."""
pass
2019-10-08 09:30:31 +00:00
class ConfigError(DoctorError):
"""Errors related to config file handling."""
pass
class TemplateError(DoctorError):
"""Errors related to template file handling."""