From: Christian Heller Date: Mon, 6 Oct 2025 19:35:08 +0000 (+0200) Subject: Don't use overly-broad BaseException where inadequate. X-Git-Url: https://plomlompom.com/repos/%22https:/validator.w3.org/%7B%7Bdb.prefix%7D%7D/tasks?a=commitdiff_plain;h=4eb9290f148884d8822c030a7414d11374b1151a;p=ircplom Don't use overly-broad BaseException where inadequate. --- diff --git a/src/ircplom/client.py b/src/ircplom/client.py index 141b59e..330022d 100644 --- a/src/ircplom/client.py +++ b/src/ircplom/client.py @@ -21,15 +21,15 @@ from ircplom.msg_parse_expectations import MSG_EXPECTATIONS _NAMES_DESIRED_SERVER_CAPS = ('sasl',) -class SendFail(BaseException): +class SendFail(Exception): 'When Client.send fails.' -class TargetUserOffline(BaseException): +class TargetUserOffline(Exception): 'When according to server our target user is not to be found.' -class ImplementationFail(BaseException): +class ImplementationFail(Exception): 'When no matching parser found for server message.' diff --git a/src/run.py b/src/run.py index 2b17f64..90c03cd 100755 --- a/src/run.py +++ b/src/run.py @@ -43,7 +43,7 @@ def main_loop(cls_term: type[TerminalInterface], cls_tui: type[BaseTui] if __name__ == '__main__': - class _HandledException(BaseException): + class _HandledException(Exception): 'To fail with only passed message rather than stack listing' try: