mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-17 06:00:42 +01:00
Catch the proper errors when a field isn't found.
This commit is contained in:
parent
9f6e826481
commit
4030026c4c
@ -412,7 +412,7 @@ class Weather(callbacks.Plugin):
|
|||||||
else:
|
else:
|
||||||
dew = deg.join((dew, unit))
|
dew = deg.join((dew, unit))
|
||||||
resp.append('Dew Point: %s.' % dew)
|
resp.append('Dew Point: %s.' % dew)
|
||||||
except ValueError:
|
except (ValueError, KeyError):
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
resp.append('Wind: %s at %s %s.' % tuple(info['Wind'].split()))
|
resp.append('Wind: %s at %s %s.' % tuple(info['Wind'].split()))
|
||||||
@ -425,7 +425,7 @@ class Weather(callbacks.Plugin):
|
|||||||
else:
|
else:
|
||||||
dew = deg.join((chill, unit))
|
dew = deg.join((chill, unit))
|
||||||
resp.append('Windchill: %s.' % chill)
|
resp.append('Windchill: %s.' % chill)
|
||||||
except (ValueError, TypeError):
|
except (ValueError, KeyError):
|
||||||
pass
|
pass
|
||||||
if info['Pressure']:
|
if info['Pressure']:
|
||||||
resp.append('Pressure: %s.' % info['Pressure'])
|
resp.append('Pressure: %s.' % info['Pressure'])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user