From 800a27ca8f9953ff24d6f2528e685e2c6b851e7a Mon Sep 17 00:00:00 2001 From: rht Date: Tue, 14 Nov 2023 07:20:51 -0500 Subject: [PATCH] IRC: Handle Error. --- zulip/integrations/bridge_with_irc/irc_mirror_backend.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/zulip/integrations/bridge_with_irc/irc_mirror_backend.py b/zulip/integrations/bridge_with_irc/irc_mirror_backend.py index e5da43c9e..13aea5c3f 100644 --- a/zulip/integrations/bridge_with_irc/irc_mirror_backend.py +++ b/zulip/integrations/bridge_with_irc/irc_mirror_backend.py @@ -1,13 +1,13 @@ -import logging import multiprocessing as mp import sys from typing import Any, Dict, Optional import irc.bot import irc.strings -from irc.client import Event, ServerConnection, ip_numstr_to_quad +from irc.client import Event, ServerConnection, ip_numstr_to_quad, IRCError -logging.basicConfig(level=logging.DEBUG) +# Uncomment this for debugging +# logging.basicConfig(level=logging.DEBUG) class IRCBot(irc.bot.SingleServerIRCBot): @@ -144,3 +144,6 @@ def on_dccchat(self, c: ServerConnection, e: Event) -> None: except ValueError: return self.dcc_connect(address, port) + + def on_error(self, c: ServerConnection, e: Event) -> None: + raise IRCError(e.target)