diff --git a/bumblebee_status/modules/contrib/stock.py b/bumblebee_status/modules/contrib/stock.py index c8bfb5e..36afe17 100644 --- a/bumblebee_status/modules/contrib/stock.py +++ b/bumblebee_status/modules/contrib/stock.py @@ -56,7 +56,11 @@ class Module(core.module.Module): self.__symbols + "&fields=regularMarketPrice,currency,regularMarketChange" ) - return urllib.request.urlopen(url).read().strip() + try: + return urllib.request.urlopen(url).read().strip() + except urllib.request.URLError: + logging.error("unable to open stock exchange url") + return None else: logging.error("unable to retrieve stock exchange rate") return None