mirror of
https://github.com/thegeeklab/prometheus-pve-sd.git
synced 2024-11-01 08:00:38 +00:00
23 lines
498 B
Python
23 lines
498 B
Python
#!/usr/bin/env python3
|
|
"""Custom exceptions."""
|
|
|
|
|
|
class PrometheusSDError(Exception):
|
|
"""Generic exception class for Prometheus-pve-sd."""
|
|
|
|
def __init__(self, msg, original_exception=""):
|
|
super().__init__(f"{msg}\n{original_exception}")
|
|
self.original_exception = original_exception
|
|
|
|
|
|
class APIError(PrometheusSDError):
|
|
"""Errors related to API connections."""
|
|
|
|
pass
|
|
|
|
|
|
class ConfigError(PrometheusSDError):
|
|
"""Errors related to config file handling."""
|
|
|
|
pass
|