Better error message in debug log when failed to fetch a news article

This commit is contained in:
Kovid Goyal 2011-01-17 10:11:22 -07:00
parent 4259d185e7
commit 5e2a2d71a6

View File

@ -839,7 +839,13 @@ class BasicNewsRecipe(Recipe):
fetcher.image_url_processor = self.image_url_processor fetcher.image_url_processor = self.image_url_processor
res, path, failures = fetcher.start_fetch(url), fetcher.downloaded_paths, fetcher.failed_links res, path, failures = fetcher.start_fetch(url), fetcher.downloaded_paths, fetcher.failed_links
if not res or not os.path.exists(res): 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 return res, path, failures
def fetch_article(self, url, dir, f, a, num_of_feeds): def fetch_article(self, url, dir, f, a, num_of_feeds):