Implemented exception handling for missing internet
This commit is contained in:
parent
b3aebcb780
commit
c6a9ce0ce8
1 changed files with 4 additions and 1 deletions
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue