浏览代码

fix: log exception when issues of collection querying

thiswillbeyourgithub 7 月之前
父节点
当前提交
53f03f6556
共有 1 个文件被更改,包括 7 次插入4 次删除
  1. 7 4
      backend/open_webui/apps/rag/utils.py

+ 7 - 4
backend/open_webui/apps/rag/utils.py

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