Add HTTP error code to download error message

master
pictuga 2014-11-09 15:45:01 +01:00
parent 6d5bb2b3c5
commit 5dd262139d
1 changed files with 2 additions and 0 deletions

View File

@ -550,6 +550,8 @@ def Fetch(url, cache, options):
accept=('xml', 'html'))
con = urllib2.build_opener(opener).open(url, timeout=TIMEOUT * 2)
xml = con.read()
except (urllib2.HTTPError) as e:
raise MorssException('Error downloading feed (HTTP Error %s)' % e.code)
except (IOError, httplib.HTTPException):
raise MorssException('Error downloading feed')