We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 435db00 commit 76b3f85Copy full SHA for 76b3f85
biothings/hub/dataindex/indexer_task.py
@@ -1,4 +1,3 @@
1
-import json
2
import logging
3
from collections import namedtuple
4
from enum import Enum
@@ -10,6 +9,7 @@
10
9
11
from biothings.utils.es import ESIndex as BaseESIndex
12
from biothings.utils.loggers import get_logger
+from biothings.utils.serializer import to_json
13
14
try:
15
from biothings.utils.mongo import doc_feeder
@@ -93,7 +93,7 @@ def _action(doc):
93
self.logger.error(error)
94
self.logger.error("Document ID %s failed: %s", document_id, reason)
95
96
- serialized_errors = json.dumps(errors, indent=2, default=str)
+ 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}"
0 commit comments