diff --git a/bumblebee/modules/github.py b/bumblebee/modules/github.py index 891c3e28..7a645943 100644 --- a/bumblebee/modules/github.py +++ b/bumblebee/modules/github.py @@ -44,9 +44,13 @@ def update(self, widgets): notifications = requests.get("https://api.github.com/notifications", headers={"Authorization":"token {}".format(token)}).text unread = 0 - for notification in json.loads(notifications): - if "unread" in notification and notification["unread"]: - unread += 1 - self._count = unread + try: + for notification in json.loads(notifications): + if "unread" in notification and notification["unread"]: + unread += 1 + self._count = unread + except Exception: + self._count = "n/a" + # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 diff --git a/bumblebee/modules/weather.py b/bumblebee/modules/weather.py index 683f61df..01420e37 100644 --- a/bumblebee/modules/weather.py +++ b/bumblebee/modules/weather.py @@ -70,5 +70,7 @@ def update(self, widgets): self._valid = True except RequestException: self._valid = False + except Exception: + self._valid = False # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4