correct to show warning in logs, but not error out on mapper exceptions

This commit is contained in:
Michaela Wheeler 2021-12-31 07:53:00 +11:00
parent 94b695e907
commit 35bb4b9e4a

View File

@ -28,8 +28,8 @@ def lambda_handler(event, context):
result = es.request(body, f"telm-{index}/_doc/_bulk", "POST")
if 'errors' in result and result['errors'] == True:
error_types = [x['index']['error']['type'] for x in result['items'] if 'error' in x['index']] # get all the error types
print(event)
print(result)
error_types = [a for a in error_types if a != 'mapper_parsing_exception'] # filter out mapper failures since they will never succeed
if error_types:
print(event)
print(result)
raise RuntimeError