Skip to content

Commit

Permalink
fix: 🐛 replace undefined exception
Browse files Browse the repository at this point in the history
IndexMissingException is replaced by NotFoundError

close #294
  • Loading branch information
newgene committed Oct 24, 2023
1 parent 069adf6 commit dfe28f0
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions biothings/utils/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,16 +293,14 @@ def update(self, id, extra_doc):
self.target_esidxer.update(id, extra_doc, bulk=True)

def drop(self):
from utils.es import IndexMissingException

conn = self.target_esidxer.conn
index_name = self.target_esidxer.ES_INDEX_NAME
index_type = self.target_esidxer.ES_INDEX_TYPE

# Check if index_type exists
try:
conn.get_mapping(index_type, index_name)
except IndexMissingException:
except NotFoundError:
return
return conn.delete_mapping(index_name, index_type)

Expand Down

0 comments on commit dfe28f0

Please sign in to comment.