elexis1 / limnoria-phabricator

A plugin for the limnoria IRC bot, posting details about phabricator revisions.
0 stars 0 forks source link

Don't end upon disconnect #21

Open elexis1 opened 6 years ago

elexis1 commented 6 years ago

Similar to #4 there are other connection issues which are not cought, throw an error and end the reporting plugin.

For instance

  File "/usr/lib64/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "/usr/lib64/python3.5/threading.py", line 862, in run
    self._target(*self._args, **self._kwargs)
  File "/home/wfgbot/wfgmeetingbot/plugins/Phabricator/plugin.py", line 258, in printStoriesForever
    if self.printSomeStories(irc):
  File "/home/wfgbot/wfgmeetingbot/plugins/Phabricator/plugin.py", line 268, in printSomeStories
    stories = self.pullSomeStories()
  File "/home/wfgbot/wfgmeetingbot/plugins/Phabricator/plugin.py", line 296, in pullSomeStories
    stories, objectPHIDs, authorPHIDs = self.conduitAPI.queryFeed(self.chronokey, self.storyLimit, self.historyForwards)
  File "/home/wfgbot/wfgmeetingbot/plugins/Phabricator/plugin.py", line 603, in queryFeed
    results = self.queryAPI("/api/feed.query", arguments)
  File "/home/wfgbot/wfgmeetingbot/plugins/Phabricator/plugin.py", line 487, in queryAPI
    conn.request("GET", path, urllib.parse.urlencode(params, True), headers)
  File "/usr/lib64/python3.5/http/client.py", line 1107, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib64/python3.5/http/client.py", line 1152, in _send_request
    self.endheaders(body)
  File "/usr/lib64/python3.5/http/client.py", line 1103, in endheaders
    self._send_output(message_body)
  File "/usr/lib64/python3.5/http/client.py", line 934, in _send_output
    self.send(msg)
  File "/usr/lib64/python3.5/http/client.py", line 877, in send
    self.connect()
  File "/usr/lib64/python3.5/http/client.py", line 1253, in connect
    super().connect()
  File "/usr/lib64/python3.5/http/client.py", line 849, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "/usr/lib64/python3.5/socket.py", line 712, in create_connection
    raise err
  File "/usr/lib64/python3.5/socket.py", line 703, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
elexis1 commented 6 years ago

On this ConnectionRefusedError the bot will discontinue / hang within the printStoriesForever loop and not print stories anymore.