mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Add docstrings to patroni.exceptions (#2703)
This commit is contained in:
+23
-1
@@ -1,33 +1,55 @@
|
|||||||
|
"""Implement high-level Patroni exceptions.
|
||||||
|
|
||||||
|
More specific exceptions can be found in other modules, as subclasses of any exception defined in this module.
|
||||||
|
"""
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
|
||||||
class PatroniException(Exception):
|
class PatroniException(Exception):
|
||||||
|
"""Parent class for all kind of Patroni exceptions.
|
||||||
|
|
||||||
"""Parent class for all kind of exceptions related to selected distributed configuration store"""
|
:ivar value: description of the exception.
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self, value: Any) -> None:
|
def __init__(self, value: Any) -> None:
|
||||||
|
"""Create a new instance of :class:`PatroniException` with the given description.
|
||||||
|
|
||||||
|
:param value: description of the exception.
|
||||||
|
"""
|
||||||
self.value = value
|
self.value = value
|
||||||
|
|
||||||
|
|
||||||
class PatroniFatalException(PatroniException):
|
class PatroniFatalException(PatroniException):
|
||||||
|
"""Catastrophic exception that prevents Patroni from performing its job."""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class PostgresException(PatroniException):
|
class PostgresException(PatroniException):
|
||||||
|
"""Any exception related with Postgres management."""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class DCSError(PatroniException):
|
class DCSError(PatroniException):
|
||||||
|
"""Parent class for all kind of DCS related exceptions."""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class PostgresConnectionException(PostgresException):
|
class PostgresConnectionException(PostgresException):
|
||||||
|
"""Any problem faced while connecting to a Postgres instance."""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class WatchdogError(PatroniException):
|
class WatchdogError(PatroniException):
|
||||||
|
"""Any problem faced while managing a watchdog device."""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class ConfigParseError(PatroniException):
|
class ConfigParseError(PatroniException):
|
||||||
|
"""Any issue identified while loading or validating the Patroni configuration."""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user