IRC: Handle error by displaying the error message.

The proper solution would be to handle each errors differently. But for
now, logging the message is at least informative to the user.
This commit is contained in:
rht 2023-11-15 07:02:27 -05:00 committed by Anders Kaseorg
parent 28cae1a71c
commit ad9b0e62a4

View file

@ -1,3 +1,4 @@
import logging
import multiprocessing as mp
import sys
from typing import Any, Dict, Optional
@ -141,3 +142,6 @@ class IRCBot(irc.bot.SingleServerIRCBot):
except ValueError:
return
self.dcc_connect(address, port)
def on_error(self, c: ServerConnection, e: Event) -> None:
logging.error("error from server: %s", e.target)