Private
Public Access
1
0

bug fix addition error checking on METAR

This commit is contained in:
Sander Roosendaal
2018-02-20 10:45:40 +01:00
parent 91890073de
commit e361825889

View File

@@ -45,7 +45,12 @@ def get_metar_data(airportcode,unixtime):
url += str(unixtime+3600) url += str(unixtime+3600)
url += "&stationString="+airportcode url += "&stationString="+airportcode
s = requests.get(url) try:
s = requests.get(url)
except:
message = 'Failed to download METAR data'
return [0,0,message,'','']
if s.ok: if s.ok:
doc = etree.fromstring(s.content) doc = etree.fromstring(s.content)