Make sure we reply if all of our fallbacks fail.

This commit is contained in:
James Vega 2004-11-16 00:55:00 +00:00
parent 1e159fb386
commit fda6b572a7
2 changed files with 5 additions and 0 deletions

View File

@ -134,6 +134,8 @@ class Weather(callbacks.Privmsg):
break
except NoLocation:
self.log.info('%s lookup failed as backup.', command)
irc.error('Could not retrieve weather for %s.' %
utils.quoted(location))
weather = wrap(weather, [additional('text')])

View File

@ -71,6 +71,9 @@ if network:
def testNoEscapingWebError(self):
self.assertNotRegexp('ham "buenos aires"', 'WebError')
def testWeatherRepliesWithBogusLocation(self):
self.assertRegexp('weather some place that doesn\'t exist', r'.')
def testConvertConfig(self):
try:
convert = conf.supybot.plugins.Weather.convert()