From: Christian Heller Date: Sun, 5 Oct 2025 04:58:04 +0000 (+0200) Subject: Report ImplementationFail across all Client windows (since we can't know which should... X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/calendar?a=commitdiff_plain;h=f8d782cdffb2888c05354bce7b6460a245ce08ef;p=ircplom Report ImplementationFail across all Client windows (since we can't know which should be interested). --- diff --git a/src/ircplom/client.py b/src/ircplom/client.py index 619d554..e01c350 100644 --- a/src/ircplom/client.py +++ b/src/ircplom/client.py @@ -947,7 +947,7 @@ class Client(ABC, ClientQueueMixin): ret = result break if '_verb' not in ret: - raise ImplementationFail(f'No handler implemented for: {msg.raw}') + raise ImplementationFail(msg.raw) for n_u_h in ret['_nickuserhosts']: # update, turn into proper users if (id_ := self.db.users.id_for_nickuserhost( n_u_h, allow_none=True, updating=True)): diff --git a/src/ircplom/client_tui.py b/src/ircplom/client_tui.py index 859a06a..08fbbfd 100644 --- a/src/ircplom/client_tui.py +++ b/src/ircplom/client_tui.py @@ -504,7 +504,10 @@ class ClientKnowingTui(Client): try: super().handle_msg(msg) except ImplementationFail as e: - self._alert(str(e)) + for scope in (_LogScope.DEBUG, _LogScope.ALL): + self._client_tui_trigger( + 'log', msg=f'No handler implemented for: {e}', + scope=scope, alert=True) except TargetUserOffline as e: name = f'{e}' self._log(f'{name} not online', target=name, alert=True) diff --git a/src/tests/test.test b/src/tests/test.test index ab814aa..f15fc0a 100644 --- a/src/tests/test.test +++ b/src/tests/test.test @@ -162,10 +162,6 @@ 1 ..# /window.raw VERB [PARAMS_STR] 1 ..# /window.reconnect -# test lack of implementation -:0:1 ..< foo bar baz -1 .!$ No handler implemented for: foo bar baz - # test recoverable 432 > /nick @foo 1 ..> NICK :@foo @@ -317,6 +313,11 @@ 1 ..$ channels:#test cleared 1 ..$ users:3 cleared +# handle lack of implementation +:0:1 ..< foo bar baz +1 .!$ No handler implemented for: foo bar baz +2,3,4,5,6,7 .!$ No handler implemented for: foo bar baz + # fail to reconnect while connected > /reconnect 1 .!$ not re-connecting since already connected