File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 99
1010from biothings .utils .es import ESIndex as BaseESIndex
1111from biothings .utils .loggers import get_logger
12+ from biothings .utils .serializer import to_json
1213
1314try :
1415 from biothings .utils .mongo import doc_feeder
@@ -92,8 +93,12 @@ def _action(doc):
9293 self .logger .error (error )
9394 self .logger .error ("Document ID %s failed: %s" , document_id , reason )
9495
95- self .logger .warning ("Discovered errors during the bulk index task. Defaulting to 0 indexed documents" )
96- return 0
96+ serialized_errors = to_json (errors , indent = True )
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
97102
98103 # NOTE
99104 # Why doesn't "mget", "mexists", "mindex" belong to the base class?
You can’t perform that action at this time.
0 commit comments