mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-28 03:20:48 +01:00
Forgot return after irc.error and added test for non-existent location.
This commit is contained in:
parent
ce67b6ef5a
commit
550f0fb3de
@ -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>')
|
||||
|
@ -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:
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user