Permalink
Browse files

Merge branch 'master' of github.com:akkana/feedme

  • Loading branch information...
2 parents 546fd18 + 9881cc6 commit ea423d6b54d130ea2d5a02883c1edfe3f37d6284 @akkana committed Sep 20, 2012
Showing with 10 additions and 2 deletions.
  1. +8 −2 feedme
  2. +2 −0 feedmeparser.py
View
@@ -187,6 +187,7 @@ class MsgLog :
def err(self, s) :
self.errstr += "\n" + s
print "ERROR:", s.encode('ascii', 'backslashreplace')
+ traceback.print_stack()
def get_msgs(self) :
return self.msgstr
@@ -373,6 +374,11 @@ def get_feed(feedname, config, cache, cachefile, last_time, msglog) :
global VersionString
downloaded_string ="\n<hr><i>(Downloaded by " + VersionString + ")</i>\n"
+ # feedparser doesn't understand file:// URLs, so translate those
+ # to a local file:
+ if sitefeedurl.startswith('file://'):
+ sitefeedurl = sitefeedurl[7:]
+
# feedparser.parse() can throw unexplained errors like
# "xml.sax._exceptions.SAXException: Read failed (no details available)"
# which will kill our whole process, so guard against that:
@@ -550,7 +556,7 @@ Which (default = s): """)
if verbose :
print >>sys.stderr, "=============="
- msglog.err(errmsg)
+ msglog.err("IO or HTTP error: " + errmsg)
if verbose :
print >>sys.stderr, "=============="
#raise # so this entry won't get stored or cached
@@ -581,7 +587,7 @@ Which (default = s): """)
if verbose :
print >>sys.stderr, "=============="
- msglog.err(errmsg)
+ msglog.err("Unknown error: " + errmsg)
if verbose :
print >>sys.stderr, "=============="
continue # Move on to next story, ensure we get index
View
@@ -74,6 +74,8 @@ def fetch_url(self, url, newdir, newname, title=None, author=None,
request.add_header('Referer', referrer)
response = urllib2.urlopen(request)
+ # Lots of ways this can fail.
+ # e.g. ValueError, "unknown url type"
# At this point it would be lovely to check whether the
# mime type is HTML. Unfortunately, all we have is a

0 comments on commit ea423d6

Please sign in to comment.