mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-26 15:40:21 +00:00
Remove __str__ method from PatroniException. (#2688)
The `__str__` method was calling `repr` over the exception message, which was causing `print` calls to render not so nicely, e.g.: ``` $ patronictl show-config Error: 'Can not find suitable configuration of distributed configuration store\nAvailable implementations: consul, etcd, etcd3, exhibitor, kubernetes, raft, zookeeper' ``` By removing the `__str__` method we get a better rendering, e.g.: ``` $ patronictl show-config Error: Can not find suitable configuration of distributed configuration store Available implementations: consul, etcd, etcd3, exhibitor, kubernetes, raft, zookeeper ``` References: PAT-107. Signed-off-by: Israel Barth Rubio <[email protected]>
This commit is contained in:
@@ -8,13 +8,6 @@ class PatroniException(Exception):
|
||||
def __init__(self, value: Any) -> None:
|
||||
self.value = value
|
||||
|
||||
def __str__(self) -> str:
|
||||
"""
|
||||
>>> str(PatroniException('foo'))
|
||||
"'foo'"
|
||||
"""
|
||||
return repr(self.value)
|
||||
|
||||
|
||||
class PatroniFatalException(PatroniException):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user