jahschwa / sibyl

a python chatbot with a focus on XBMC
GNU General Public License v3.0
7 stars 6 forks source link

xmpp: better error handling #59

Open jahschwa opened 5 years ago

jahschwa commented 5 years ago

Several calls don't catch and re-raise exceptions that should. For example, __idle_ping():

2019-02-20 03:13:04 | sibylbot | CRI | UNHANDLED: SystemShutdown

Traceback (most recent call last):
  File "/usr/src/app/sibyl/lib/sibylbot.py", line 1186, in run_forever
    self.__run_forever()
  File "/usr/src/app/sibyl/lib/sibylbot.py", line 1065, in __run_forever
    self.__serve()
  File "/usr/src/app/sibyl/lib/sibylbot.py", line 1041, in __serve
    proto.process()
  File "protocols/sibyl_xmpp.py", line 295, in process
    self.__idle_proc()
  File "protocols/sibyl_xmpp.py", line 745, in __idle_proc
    self.__idle_ping()
  File "protocols/sibyl_xmpp.py", line 762, in __idle_ping
    self.opt('xmpp.ping_timeout'))
  File "/usr/src/app/xmpp/dispatcher.py", line 337, in SendAndWaitForResponse
    return self.WaitForResponse(self.send(stanza),timeout)
  File "/usr/src/app/xmpp/dispatcher.py", line 321, in WaitForResponse
    if not self.Process(0.04):
  File "/usr/src/app/xmpp/dispatcher.py", line 303, in dispatch
    handler['func'](session,stanza)
  File "/usr/src/app/xmpp/dispatcher.py", line 215, in streamErrorHandler
    raise exc((name,text))
SystemShutdown: (u'system-shutdown', u'Received SIGTERM')