abiczo / github-notifier

Github updates notifier for Linux
57 stars 8 forks source link

feed.status is undefined if there is not Internet connection #27

Closed dotnetCarpenter closed 7 years ago

dotnetCarpenter commented 7 years ago

status will only be present if the feed was retrieved from a web server. If the feed was parsed from a local file or from a string in memory, status will not be present. https://pythonhosted.org/feedparser/reference-status.html

This means that github-notifier will throw errors if there is no Internet connection.

I can create a PR to deal with this, but I'm not sure what is the best way to handle this.

  1. Check for feed.status before using the property
  2. Check for Internet connection in def process_feed and abort if disconnected ala http://stackoverflow.com/questions/20913411/test-if-an-internet-connection-is-present-in-python#20913928

Ideally, github-notifier would continue to pull, so that it will get results when the Internet connection is back up.

abiczo commented 7 years ago

Looks like you decided to go with approach #1 (check feed.status before using it). Agree that it is the better choice here.

dotnetCarpenter commented 7 years ago

I actually was in doubt and wanted to hear what you thought. But yes simpler is better. I'll delete #29 and squash the commits in #28.

BTW, there is a Squash and Merge button on the github pull page (just click the white down-arrow).