fix: log exception when issues of collection querying

This commit is contained in:
thiswillbeyourgithub 2024-09-12 15:34:52 +02:00
parent e510c8b11f
commit 53f03f6556
1 changed files with 7 additions and 4 deletions

View File

@ -150,8 +150,8 @@ def query_collection(
embedding_function=embedding_function,
)
results.append(result)
except Exception:
pass
except Exception as e:
log.exception(f"Error when querying the collection: {e}")
else:
pass
@ -178,8 +178,11 @@ def query_collection_with_hybrid_search(
r=r,
)
results.append(result)
except Exception:
pass
except Exception as e:
log.exception(
"Error when querying the collection with "
f"hybrid_search: {e}"
)
return merge_and_sort_query_results(results, k=k, reverse=True)