From e9f9e1cfad6d8de1dcf1a21d2d8f5e25d462f182 Mon Sep 17 00:00:00 2001 From: Israel Date: Tue, 6 Jun 2023 05:02:44 -0300 Subject: [PATCH] Add docstrings to `patroni.exceptions` (#2703) --- patroni/exceptions.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/patroni/exceptions.py b/patroni/exceptions.py index f8bf6df1..20c4797a 100644 --- a/patroni/exceptions.py +++ b/patroni/exceptions.py @@ -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 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: + """Create a new instance of :class:`PatroniException` with the given description. + + :param value: description of the exception. + """ self.value = value class PatroniFatalException(PatroniException): + """Catastrophic exception that prevents Patroni from performing its job.""" + pass class PostgresException(PatroniException): + """Any exception related with Postgres management.""" + pass class DCSError(PatroniException): + """Parent class for all kind of DCS related exceptions.""" + pass class PostgresConnectionException(PostgresException): + """Any problem faced while connecting to a Postgres instance.""" + pass class WatchdogError(PatroniException): + """Any problem faced while managing a watchdog device.""" + pass class ConfigParseError(PatroniException): + """Any issue identified while loading or validating the Patroni configuration.""" + pass