From 3b6914dee72583ab9dac7fbe8aea1d6cf9e49482 Mon Sep 17 00:00:00 2001 From: Jhen-Jie Hong Date: Sun, 22 Dec 2024 19:39:48 +0800 Subject: [PATCH] feat(ts): log error on load variant error --- lib/binding.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/binding.ts b/lib/binding.ts index 02b85c8..bfadf84 100644 --- a/lib/binding.ts +++ b/lib/binding.ts @@ -90,7 +90,9 @@ export const loadModule = async (variant?: LibVariant): Promise => { setupEnv(variant) return await import(`../bin/${process.platform}-${variant}/${process.arch}/llama-node.node`) as Module } - } catch {} // ignore errors and try the common path + } catch (e) { + console.error(`Failed to load module with variant ${variant}`, e) + } // ignore errors and try the common path setupEnv() return await import(`../bin/${process.platform}/${process.arch}/llama-node.node`) as Module } \ No newline at end of file