From d90be02a82d7ea60f28fb68283b63bee80093b86 Mon Sep 17 00:00:00 2001 From: Research Assistant Date: Tue, 12 May 2026 23:16:17 +0800 Subject: [PATCH] fix(plugin): fix try/catch mismatches in vector deps + embed status blocks --- paperforge/plugin/main.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/paperforge/plugin/main.js b/paperforge/plugin/main.js index ea35b51c..68615a05 100644 --- a/paperforge/plugin/main.js +++ b/paperforge/plugin/main.js @@ -2665,10 +2665,12 @@ class PaperForgeSettingTab extends PluginSettingTab { const pyResult = resolvePythonExecutable(vp, this.plugin.settings); const pythonPath = pyResult.path; if (pythonPath) { + try { + const { execSync } = require('child_process'); const result = execSync(`"${pythonPath}" -c "import chromadb; import sentence_transformers; print('ok')"`, { encoding: 'utf-8', timeout: 15000 }); depsOk = result.trim() === 'ok'; - } - } catch(e) { depsOk = false; } + } catch(e) { depsOk = false; } + } if (!depsOk) { const depWarning = containerEl.createEl('div', { cls: 'paperforge-vector-warning' }); @@ -2723,10 +2725,12 @@ class PaperForgeSettingTab extends PluginSettingTab { const pyResult = resolvePythonExecutable(vp, this.plugin.settings); const pythonPath = pyResult.path; if (pythonPath) { + try { + const { execSync } = require('child_process'); const result = execSync(`"${pythonPath}" -m paperforge --vault "${vp}" embed status --json`, { encoding: 'utf-8', timeout: 10000 }); embedStatus = JSON.parse(result); - } - } catch(e) {} + } catch(e) {} + } if (embedStatus && embedStatus.ok) { const statusEl = containerEl.createEl('div', { cls: 'paperforge-vector-status' });