prometheus-pve-sd/prometheuspvesd/exception.py

24 lines
559 B
Python
Raw Normal View History

2021-06-09 20:44:10 +02:00
#!/usr/bin/env python3
"""Custom exceptions."""
class PrometheusSDError(Exception):
"""Generic exception class for Prometheus-pve-sd."""
2021-06-09 20:44:10 +02:00
def __init__(self, msg, original_exception=""):
super(PrometheusSDError,
self).__init__("{msg}\n{org}".format(msg=msg, org=original_exception))
self.original_exception = original_exception
2021-06-09 22:57:48 +02:00
class APIError(PrometheusSDError):
"""Errors related to API connections."""
pass
2021-06-09 20:44:10 +02:00
class ConfigError(PrometheusSDError):
"""Errors related to config file handling."""
pass