diff --git a/plugins/Debian.py b/plugins/Debian.py index 4770dd8f8..9f2d3b45d 100644 --- a/plugins/Debian.py +++ b/plugins/Debian.py @@ -193,9 +193,13 @@ class Debian(callbacks.Privmsg, plugins.PeriodicFileDownloader): package = urllib.quote(package) url = 'http://packages.debian.org/cgi-bin/search_packages.pl?keywords'\ '=%s&searchon=names&version=%s&release=all' % (package, branch) - fd = urllib2.urlopen(url) - html = fd.read() - fd.close() + try: + fd = urllib2.urlopen(url) + html = fd.read() + fd.close() + except urllib2.HTTPError, e: + irc.error(msg, 'I couldn\'t reach the search page (%s).' % e) + return m = self._debnumpkgsre.search(html) if m: numberOfPackages = m.group(1)