Skip to content

Commit

Permalink
IRC: Handle Error.
Browse files Browse the repository at this point in the history
  • Loading branch information
rht committed Nov 14, 2023
1 parent b5be49a commit fba82f5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions zulip/integrations/bridge_with_irc/irc_mirror_backend.py
Original file line number Diff line number Diff line change
@@ -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, IRCError, ServerConnection, ip_numstr_to_quad

logging.basicConfig(level=logging.DEBUG)
# Uncomment this for debugging
# logging.basicConfig(level=logging.DEBUG)


class IRCBot(irc.bot.SingleServerIRCBot):
Expand Down Expand Up @@ -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)

0 comments on commit fba82f5

Please sign in to comment.