2019-10-08 11:30:31 +02:00
|
|
|
#!/usr/bin/env python3
|
2023-01-21 22:17:54 +01:00
|
|
|
"""Doctor exception module."""
|
2019-10-08 11:30:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
class DoctorError(Exception):
|
2023-01-21 22:17:54 +01:00
|
|
|
"""Define generic exception."""
|
2019-10-08 11:30:31 +02:00
|
|
|
|
|
|
|
def __init__(self, msg, original_exception=""):
|
2023-01-20 11:56:12 +01:00
|
|
|
super().__init__(f"{msg}\n{original_exception}")
|
2019-10-08 11:30:31 +02:00
|
|
|
self.original_exception = original_exception
|
|
|
|
|
|
|
|
|
2023-11-12 21:39:41 +01:00
|
|
|
class YAMLError(DoctorError):
|
|
|
|
"""Errors while reading a yaml file."""
|
|
|
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2019-10-08 11:30:31 +02:00
|
|
|
class ConfigError(DoctorError):
|
|
|
|
"""Errors related to config file handling."""
|
|
|
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2024-06-12 20:59:55 +02:00
|
|
|
class TemplateError(DoctorError):
|
|
|
|
"""Errors related to template file handling."""
|