From b34dc46bd03c712edfb8cfaf2dfa699ab6ddd3e0 Mon Sep 17 00:00:00 2001 From: diegosouzapw Date: Tue, 19 May 2026 02:16:01 -0300 Subject: [PATCH] fix(triage): clarify JSON parse errors in gh wrapper --- scripts/features/lib/github.mjs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/features/lib/github.mjs b/scripts/features/lib/github.mjs index c4f212dfd5..800708db42 100644 --- a/scripts/features/lib/github.mjs +++ b/scripts/features/lib/github.mjs @@ -7,7 +7,13 @@ import { execFileSync } from "node:child_process"; function runJson(cmd, args) { const out = execFileSync(cmd, args, { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }); - return JSON.parse(out); + try { + return JSON.parse(out); + } catch (e) { + throw new Error( + `Failed to parse JSON from ${cmd}: ${e.message}\nOutput (first 200 chars): ${out.slice(0, 200)}` + ); + } } function runText(cmd, args) {