exit if a TimeoutError occurs

This commit is contained in:
jkhsjdhjs 2024-11-26 13:40:06 +00:00
parent 51a37c4562
commit b29cf737a7

View File

@ -140,7 +140,11 @@ def me(chan, msg):
def getData():
try:
raw = irc.recv(4096)
except TimeoutError:
print("Connection timed out!")
sys.exit(0)
if not raw:
print("Connection lost!")
sys.exit(0)