Commit a51d29e4 authored by Sébastien DA ROCHA's avatar Sébastien DA ROCHA
Browse files

Add error logs when indexing to ingest

parent 3a535bc4
Pipeline #21930 passed with stage
in 26 seconds
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment