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: 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'])