2019-10-08 09:30:31 +00:00
|
|
|
#!/usr/bin/env python3
|
2023-01-21 21:17:54 +00:00
|
|
|
"""Doctor exception module."""
|
2019-10-08 09:30:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
class DoctorError(Exception):
|
2023-01-21 21:17:54 +00:00
|
|
|
"""Define generic exception."""
|
2019-10-08 09:30:31 +00:00
|
|
|
|
|
|
|
def __init__(self, msg, original_exception=""):
|
2023-01-20 10:56:12 +00:00
|
|
|
super().__init__(f"{msg}\n{original_exception}")
|
2019-10-08 09:30:31 +00:00
|
|
|
self.original_exception = original_exception
|
|
|
|
|
|
|
|
|
2023-11-12 20:39:41 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
|
2024-06-12 18:59:55 +00:00
|
|
|
class TemplateError(DoctorError):
|
|
|
|
"""Errors related to template file handling."""
|