From 5e2a2d71a61bfdb85d191461a2d7be5a252436e6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 17 Jan 2011 10:11:22 -0700 Subject: [PATCH] Better error message in debug log when failed to fetch a news article --- src/calibre/web/feeds/news.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/calibre/web/feeds/news.py b/src/calibre/web/feeds/news.py index dd32d3749f..6215132e4b 100644 --- a/src/calibre/web/feeds/news.py +++ b/src/calibre/web/feeds/news.py @@ -839,7 +839,13 @@ class BasicNewsRecipe(Recipe): fetcher.image_url_processor = self.image_url_processor res, path, failures = fetcher.start_fetch(url), fetcher.downloaded_paths, fetcher.failed_links if not res or not os.path.exists(res): - raise Exception(_('Could not fetch article. Run with -vv to see the reason')) + msg = _('Could not fetch article.') + ' ' + if self.debug: + msg += _('The debug traceback is available earlier in this log') + else: + msg += _('Run with -vv to see the reason') + raise Exception(msg) + return res, path, failures def fetch_article(self, url, dir, f, a, num_of_feeds): @@ -901,7 +907,7 @@ class BasicNewsRecipe(Recipe): if self.test: feeds = feeds[:2] self.has_single_feed = len(feeds) == 1 - + index = os.path.join(self.output_dir, 'index.html') html = self.feeds2index(feeds)