Verified Commit 1e3b2985 authored by Baptiste Beauplat's avatar Baptiste Beauplat
Browse files

Catch timeout when tracker.d.o is not responding

parent 6326e2d7
...@@ -43,6 +43,7 @@ __license__ = 'MIT' ...@@ -43,6 +43,7 @@ __license__ = 'MIT'
import logging import logging
import lxml.html import lxml.html
import urllib2 import urllib2
from socket import timeout
from debexpo.model import meta from debexpo.model import meta
from debexpo.model.users import User from debexpo.model.users import User
...@@ -60,7 +61,8 @@ class DebianPlugin(BasePlugin): ...@@ -60,7 +61,8 @@ class DebianPlugin(BasePlugin):
try: try:
self.qa_page = urllib2.urlopen('https://tracker.debian.org/%s' % self.qa_page = urllib2.urlopen('https://tracker.debian.org/%s' %
self.changes['Source']) self.changes['Source'])
except urllib2.HTTPError: except (urllib2.HTTPError, timeout) as e:
log.error('Failed to contact tracker: {}'.format(e))
return return
self.parsed_qa = lxml.html.fromstring(self.qa_page.read()) self.parsed_qa = lxml.html.fromstring(self.qa_page.read())
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment