wylark
/
infoex-autowx.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ab9d94e
)
Catch KeyError exception when interpreting json
author
Alexander Vasarab <alexander@wylark.com>
Tue, 2 Feb 2021 06:00:38 +0000
(22:00 -0800)
committer
Alexander Vasarab <alexander@wylark.com>
Tue, 2 Feb 2021 06:00:38 +0000
(22:00 -0800)
infoex-autowx.py
patch
|
blob
|
history
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)