Forgot return after irc.error and added test for non-existent location.

This commit is contained in:
Jeremy Fincher 2003-08-27 22:30:48 +00:00
parent ce67b6ef5a
commit 550f0fb3de
2 changed files with 3 additions and 2 deletions

View File

@ -304,6 +304,7 @@ class Http(callbacks.Privmsg):
fd.close()
if 'was not found' in html:
irc.error(msg, 'No such location could be found.')
return
headData = self._cityregex.search(html)
if headData:
(city, state, country) = headData.groups()
@ -324,7 +325,7 @@ class Http(callbacks.Privmsg):
except urllib2.URLError:
irc.error(msg, 'I couldn\'t open the search page.')
except Exception, e:
debug.recoverableError()
debug.recoverableException()
irc.error(msg, debug.exnToString(e))
_geekquotere = re.compile('<p class="qt">(.*?)</p>')

View File

@ -78,7 +78,7 @@ class HttpTest(PluginTestCase):
self.assertNotError('weather Columbus, OH')
self.assertNotError('weather 43221')
self.assertNotRegexp('weather Paris, FR', 'Virginia')
self.assertError('weather alsdkfjasdl, asdlfkjsadlfkj')
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: