diff --git a/bumblebee/modules/github.py b/bumblebee/modules/github.py index 891c3e2..7a64594 100644 --- a/bumblebee/modules/github.py +++ b/bumblebee/modules/github.py @@ -44,9 +44,13 @@ class Module(bumblebee.engine.Module): 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 683f61d..01420e3 100644 --- a/bumblebee/modules/weather.py +++ b/bumblebee/modules/weather.py @@ -70,5 +70,7 @@ class Module(bumblebee.engine.Module): self._valid = True except RequestException: self._valid = False + except Exception: + self._valid = False # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4