From 88a816fc4b2a939ba71e20f5d76f2e0e2bcb491d Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Wed, 3 Jun 2026 12:03:31 +0200 Subject: [PATCH] fix: surface generate_ast.py failures with a clear error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit spawnSync only sets .error when the spawn itself fails — a non-zero exit of the script went unnoticed and the plugin died later with a confusing "ENOENT: pydoc-markdown-dump.json". Check the exit code and include the script's stderr in the thrown error so the real cause (e.g. a missing pydoc-markdown install) is visible in CI logs. --- src/plugin/python/index.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plugin/python/index.ts b/src/plugin/python/index.ts index e106d63..d804035 100644 --- a/src/plugin/python/index.ts +++ b/src/plugin/python/index.ts @@ -31,7 +31,13 @@ export function processPythonDocs({ ]); if (out.error) { - throw new Error(out.error.message); + throw new Error(`Failed to spawn the generate_ast.py script: ${out.error.message}`); + } + + if (out.status !== 0) { + throw new Error( + `The generate_ast.py script failed with exit code ${out.status}:\n${out.stderr.toString()}`, + ); } const moduleShortcuts = JSON.parse(fs.readFileSync(moduleShortcutsPath, 'utf8')) as Record<