Prevent crash when bot calls _connect and fails due to dns lookup failure

This commit is contained in:
Dave Pedu 2016-04-25 07:49:52 -07:00
parent 2505da666a
commit 12ed393f6c
1 changed files with 6 additions and 1 deletions

View File

@ -9,6 +9,7 @@
import logging
import time
import sys
import traceback
from pyircbot.rpc import BotRPC
from pyircbot.irccore import IRCCore
import os.path
@ -63,7 +64,11 @@ class PyIRCBot:
self.connect()
def connect(self):
try:
self.irc._connect()
except:
self.log.error("Pyircbot attempted to connect and failed!")
self.log.error(traceback.format_exc())
def loop(self):
self.irc.loop()