wylark
/
infoex-autowx.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Catch KeyError exception when interpreting json
[infoex-autowx.git]
/
infoex-autowx.py
diff --git
a/infoex-autowx.py
b/infoex-autowx.py
index f2be003d5c792c62f3153a4d2b7ac4404e697eb0..9bd77c1f8315d1ad4528bd11859cad8eadeb3ae3 100755
(executable)
--- a/
infoex-autowx.py
+++ b/
infoex-autowx.py
@@
-473,6
+473,9
@@
def get_mesowest_data(begin, end, station):
try:
observations = json['STATION'][0]['OBSERVATIONS']
+ except KeyError:
+ LOG.error("Unexpected JSON in MesoWest response")
+ sys.exit(1)
except ValueError:
LOG.error("Bad JSON in MesoWest response")
sys.exit(1)