summaryrefslogtreecommitdiffstats
path: root/fatcat_scholar
diff options
context:
space:
mode:
Diffstat (limited to 'fatcat_scholar')
-rw-r--r--fatcat_scholar/worker.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/fatcat_scholar/worker.py b/fatcat_scholar/worker.py
index d2cc3cb..4c1b9d7 100644
--- a/fatcat_scholar/worker.py
+++ b/fatcat_scholar/worker.py
@@ -145,9 +145,12 @@ class IndexDocsWorker(KafkaWorker):
if not bulk_actions:
return
- self.es_client.bulk(
+ resp = self.es_client.bulk(
"\n".join(bulk_actions), self.es_index, timeout="30s",
)
+ if resp.get("errors"):
+ print(resp["errors"], file=sys.stderr)
+ raise Exception("elasticsearch index response errors")
self.counts["batches-indexed"] += 1