wylark
/
infoex-autowx.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5583d80
)
Catch a few more exceptions, and Pylint fixes
author
Alexander Vasarab <alexander@wylark.com>
Tue, 2 Feb 2021 06:11:38 +0000
(22:11 -0800)
committer
Alexander Vasarab <alexander@wylark.com>
Tue, 2 Feb 2021 06:11:38 +0000
(22:11 -0800)
infoex-autowx.py
patch
|
blob
|
history
diff --git
a/infoex-autowx.py
b/infoex-autowx.py
index b979287e1a38b12d6796a3b590098ee894ba44c8..a68d778225fa22bfe10ef5a1cc6f96d4c0cbd370 100755
(executable)
--- a/
infoex-autowx.py
+++ b/
infoex-autowx.py
@@
-474,11
+474,19
@@
def get_mesowest_data(begin, end, station):
try:
observations = json['STATION'][0]['OBSERVATIONS']
try:
observations = json['STATION'][0]['OBSERVATIONS']
- except KeyError:
- LOG.error("Unexpected JSON in MesoWest response
"
)
+ except KeyError
as exc
:
+ LOG.error("Unexpected JSON in MesoWest response
: '%s'", exc
)
sys.exit(1)
sys.exit(1)
- except ValueError:
- LOG.error("Bad JSON in MesoWest response")
+ except IndexError as exc:
+ LOG.error("Unexpected JSON in MesoWest response: '%s'", exc)
+ try:
+ LOG.error("Detailed MesoWest response: '%s'",
+ json['SUMMARY']['RESPONSE_MESSAGE'])
+ except KeyError:
+ pass
+ sys.exit(1)
+ except ValueError as exc:
+ LOG.error("Bad JSON in MesoWest response: '%s'", exc)
sys.exit(1)
pos = len(observations['date_time']) - 1
sys.exit(1)
pos = len(observations['date_time']) - 1