Prevent crash when bot calls _connect and fails due to dns lookup failure
This commit is contained in:
parent
2505da666a
commit
12ed393f6c
|
@ -9,6 +9,7 @@
|
||||||
import logging
|
import logging
|
||||||
import time
|
import time
|
||||||
import sys
|
import sys
|
||||||
|
import traceback
|
||||||
from pyircbot.rpc import BotRPC
|
from pyircbot.rpc import BotRPC
|
||||||
from pyircbot.irccore import IRCCore
|
from pyircbot.irccore import IRCCore
|
||||||
import os.path
|
import os.path
|
||||||
|
@ -63,7 +64,11 @@ class PyIRCBot:
|
||||||
self.connect()
|
self.connect()
|
||||||
|
|
||||||
def connect(self):
|
def connect(self):
|
||||||
self.irc._connect()
|
try:
|
||||||
|
self.irc._connect()
|
||||||
|
except:
|
||||||
|
self.log.error("Pyircbot attempted to connect and failed!")
|
||||||
|
self.log.error(traceback.format_exc())
|
||||||
|
|
||||||
def loop(self):
|
def loop(self):
|
||||||
self.irc.loop()
|
self.irc.loop()
|
||||||
|
|
Loading…
Reference in New Issue