Redirect mercury-parser.js stderr to stdout. Moreover, if an error occurs while parsing a link from an RSS feed we should report the link that raised the error, not the URL of the parent feed

This commit is contained in:
Fabio Manganiello 2019-07-25 16:34:00 +00:00
parent 44e27e6c62
commit 1f2f293778
2 changed files with 2 additions and 2 deletions

View File

@ -146,7 +146,7 @@ class RssUpdates(HttpRequest):
break
except Exception as e:
self.logger.warning('Exception encountered while parsing RSS ' +
'RSS feed {}: {}'.format(self.url, str(e)))
'RSS feed {}: {}'.format(entry.link, str(e)))
self.logger.exception(e)
source_record.last_updated_at = parse_start_time

View File

@ -55,7 +55,7 @@ class HttpWebpagePlugin(Plugin):
"""
self.logger.info('Parsing URL {}'.format(url))
parser = subprocess.Popen(['node', self._mercury_script, url], stdout=subprocess.PIPE)
parser = subprocess.Popen(['node', self._mercury_script, url], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
response = parser.stdout.read().decode()
try: