Fixed a bug with exception handling in elastic_doc_manager