Skip to content
Snippets Groups Projects

Add error logs when indexing to ingest

Merged Sébastien DA ROCHA requested to merge sdarocha-master-patch-75691 into master
1 file
+ 8
0
Compare changes
  • Side-by-side
  • Inline
+ 8
0
@@ -159,6 +159,14 @@ def index_docs(channel, method, properties, body):
channel.basic_nack(delivery_tag = method.delivery_tag, requeue=1)
#print("")
#logging.error(json.dumps(rep, indent=4))
try:
logging.error(json.dumps([
item.get("error", {}).get("reason")
for item in rep.get("items", [])
],
indent=4))
except:
pass
raise Exception('Failed to push documents to Elasticsearch.')
return
Loading