We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d430975 commit 435db00Copy full SHA for 435db00
biothings/hub/dataindex/indexer_task.py
@@ -1,3 +1,4 @@
1
+import json
2
import logging
3
from collections import namedtuple
4
from enum import Enum
@@ -92,8 +93,12 @@ def _action(doc):
92
93
self.logger.error(error)
94
self.logger.error("Document ID %s failed: %s", document_id, reason)
95
- self.logger.warning("Discovered errors during the bulk index task. Defaulting to 0 indexed documents")
96
- return 0
+ serialized_errors = json.dumps(errors, indent=2, default=str)
97
+ message = (
98
+ f"Bulk indexing failed for index '{self.index_name}'. "
99
+ f"Elasticsearch responded with errors:\n{serialized_errors}"
100
+ )
101
+ raise helpers.BulkIndexError(message, errors) from e
102
103
# NOTE
104
# Why doesn't "mget", "mexists", "mindex" belong to the base class?
0 commit comments