From 5dd262139d72b92ed2e859ceef5529377732e6a4 Mon Sep 17 00:00:00 2001 From: pictuga Date: Sun, 9 Nov 2014 15:45:01 +0100 Subject: [PATCH] Add HTTP error code to download error message --- morss/morss.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/morss/morss.py b/morss/morss.py index d1626c5..fd32511 100644 --- a/morss/morss.py +++ b/morss/morss.py @@ -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')