mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-31 04:12:10 +03:00
fix(triage): clarify JSON parse errors in gh wrapper
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user