Catch the proper errors when a field isn't found.

This commit is contained in:
James Vega 2005-02-10 03:15:02 +00:00
parent 9f6e826481
commit 4030026c4c

View File

@ -412,7 +412,7 @@ class Weather(callbacks.Plugin):
else:
dew = deg.join((dew, unit))
resp.append('Dew Point: %s.' % dew)
except ValueError:
except (ValueError, KeyError):
pass
try:
resp.append('Wind: %s at %s %s.' % tuple(info['Wind'].split()))
@ -425,7 +425,7 @@ class Weather(callbacks.Plugin):
else:
dew = deg.join((chill, unit))
resp.append('Windchill: %s.' % chill)
except (ValueError, TypeError):
except (ValueError, KeyError):
pass
if info['Pressure']:
resp.append('Pressure: %s.' % info['Pressure'])