mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-29 21:54:22 +01:00
Added better error reporting.
This commit is contained in:
parent
c8b09bd44d
commit
ce67b6ef5a
@ -302,6 +302,8 @@ class Http(callbacks.Privmsg):
|
||||
fd = urllib2.urlopen(url)
|
||||
html = fd.read()
|
||||
fd.close()
|
||||
if 'was not found' in html:
|
||||
irc.error(msg, 'No such location could be found.')
|
||||
headData = self._cityregex.search(html)
|
||||
if headData:
|
||||
(city, state, country) = headData.groups()
|
||||
@ -319,11 +321,11 @@ class Http(callbacks.Privmsg):
|
||||
irc.reply(msg, s)
|
||||
else:
|
||||
irc.error(msg, 'The format of the page was odd.')
|
||||
|
||||
except urllib2.URLError:
|
||||
irc.error(msg, 'I couldn\'t open the search page.')
|
||||
except:
|
||||
irc.error(msg, 'The format of the page was odd.')
|
||||
except Exception, e:
|
||||
debug.recoverableError()
|
||||
irc.error(msg, debug.exnToString(e))
|
||||
|
||||
_geekquotere = re.compile('<p class="qt">(.*?)</p>')
|
||||
def geekquote(self, irc, msg, args):
|
||||
|
Loading…
Reference in New Issue
Block a user