From 53f03f65561f74927382b115d5eee5ed826015e7 Mon Sep 17 00:00:00 2001 From: thiswillbeyourgithub <26625900+thiswillbeyourgithub@users.noreply.github.com> Date: Thu, 12 Sep 2024 15:34:52 +0200 Subject: [PATCH] fix: log exception when issues of collection querying --- backend/open_webui/apps/rag/utils.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/backend/open_webui/apps/rag/utils.py b/backend/open_webui/apps/rag/utils.py index 2bf8a02e4..c179f47c0 100644 --- a/backend/open_webui/apps/rag/utils.py +++ b/backend/open_webui/apps/rag/utils.py @@ -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)