Implemented exception handling for missing internet

This commit is contained in:
Maximilian Giller 2019-02-26 22:08:00 +01:00
parent b3aebcb780
commit c6a9ce0ce8

View file

@ -10,7 +10,10 @@ class OwmForecasts (WeatherInterface):
self.units = units self.units = units
def is_available (self): def is_available (self):
try:
return self.api.is_API_online() return self.api.is_API_online()
except:
return False
def get_today_forecast (self, location): def get_today_forecast (self, location):
if self.is_available() is False: if self.is_available() is False: