diff --git a/api/core/index/vector_index/base.py b/api/core/index/vector_index/base.py index bc7811a0e2a2ee..1775ff3edfc465 100644 --- a/api/core/index/vector_index/base.py +++ b/api/core/index/vector_index/base.py @@ -6,7 +6,6 @@ from langchain.embeddings.base import Embeddings from langchain.schema import Document, BaseRetriever from langchain.vectorstores import VectorStore -from weaviate import UnexpectedStatusCodeException from core.index.base import BaseIndex from extensions.ext_database import db @@ -139,10 +138,8 @@ def recreate_dataset(self, dataset: Dataset): try: self.delete() - except UnexpectedStatusCodeException as e: - if e.status_code != 400: - # 400 means index not exists - raise e + except Exception as e: + raise e dataset_documents = db.session.query(DatasetDocument).filter( DatasetDocument.dataset_id == dataset.id, @@ -194,10 +191,8 @@ def create_qdrant_dataset(self, dataset: Dataset): try: self.delete() - except UnexpectedStatusCodeException as e: - if e.status_code != 400: - # 400 means index not exists - raise e + except Exception as e: + raise e dataset_documents = db.session.query(DatasetDocument).filter( DatasetDocument.dataset_id == dataset.id,