Handling mercury errors.

This commit is contained in:
Samuel Clay 2017-10-30 11:47:18 -07:00
parent 644759d752
commit f242a49d24

View file

@ -69,6 +69,10 @@ class TextImporter:
return
doc = resp.json()
if doc.get('error', False):
logging.user(self.request, "~SN~FRFailed~FY to fetch ~FGoriginal text~FY: %s" % doc.get('messages', "[unknown merucry error]"))
return
text = doc['content']
title = doc['title']
url = doc['url']