From 9e8f672b9a531e9f835acf93e282dfe1b8738489 Mon Sep 17 00:00:00 2001 From: Lion Date: Sat, 2 Jul 2022 17:58:15 +0800 Subject: [PATCH] err checking the searcher create --- binding/lua_c/search_test.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/binding/lua_c/search_test.lua b/binding/lua_c/search_test.lua index 41949d1..4e65a39 100644 --- a/binding/lua_c/search_test.lua +++ b/binding/lua_c/search_test.lua @@ -59,7 +59,11 @@ end -- create the searcher based on the cache-policy local searcher, v_index, content if cachePolicy == "file" then - searcher = xdb.new_with_file_only(dbFile) + searcher, err = xdb.new_with_file_only(dbFile) + if err ~= nil then + print(string.format("failed to create searcher: %s", err)) + return + end elseif cachePolicy == "vectorIndex" then v_index = xdb.load_vector_index(dbFile) if v_index == nil then