matrix-alertbot/matrix_alertbot/errors.py

72 lines
1.4 KiB
Python
Raw Normal View History

2021-01-10 04:30:07 +01:00
# This file holds custom error types that you can define for your application.
class MatrixAlertbotError(Exception):
pass
class ConfigError(MatrixAlertbotError):
2022-07-09 10:38:40 +02:00
"""An error encountered during reading the config file."""
2020-08-10 00:02:07 +02:00
pass
2022-07-09 12:22:05 +02:00
class ParseConfigError(ConfigError):
"""An error encountered when config file cannot be parsed."""
pass
class InvalidConfigError(ParseConfigError):
"""An error encountered when a config key is not valid."""
pass
class RequiredConfigKeyError(ConfigError):
"""An error encountered when a required config key is missing."""
pass
class AlertmanagerError(MatrixAlertbotError):
2022-07-09 10:38:40 +02:00
"""An error encountered with Alertmanager."""
pass
2022-07-09 10:38:40 +02:00
class AlertNotFoundError(AlertmanagerError):
"""An error encountered when an alert cannot be found in Alertmanager."""
pass
2022-07-06 00:54:13 +02:00
class SilenceNotFoundError(AlertmanagerError):
"""An error encountered when a silence cannot be found in Alertmanager."""
2022-07-10 02:40:04 +02:00
pass
class SilenceExpiredError(AlertmanagerError):
"""An error encountered when a silence is already expired in Alertmanager."""
pass
2022-08-08 00:28:36 +02:00
class SilenceExtendError(AlertmanagerError):
"""An error encountered when a silence cannot be extended."""
pass
2022-07-09 10:38:40 +02:00
class AlertmanagerServerError(AlertmanagerError):
"""An error encountered with Alertmanager server."""
2022-07-06 00:54:13 +02:00
pass
2024-01-22 11:35:13 +01:00
class MatrixClientError(MatrixAlertbotError):
"""An error encountered with the Matrix client"""
pass