fix(thread): handle null stderr from execFileSync, increase maxBuffer to 50MB
- err.stderr can be null (not just undefined) when child process fails - maxBuffer default (1MB) too small for stream-json verbose output
This commit is contained in:
@@ -661,11 +661,12 @@ function spawnAgent(
|
|||||||
encoding: "utf8",
|
encoding: "utf8",
|
||||||
env,
|
env,
|
||||||
stdio: ["ignore", "pipe", "pipe"],
|
stdio: ["ignore", "pipe", "pipe"],
|
||||||
|
maxBuffer: 50 * 1024 * 1024, // 50 MB — stream-json output can be large
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
const err = e as NodeJS.ErrnoException & { stderr?: Buffer | string };
|
const err = e as NodeJS.ErrnoException & { stderr?: Buffer | string | null };
|
||||||
const stderr =
|
const stderr =
|
||||||
err.stderr === undefined
|
err.stderr == null
|
||||||
? ""
|
? ""
|
||||||
: typeof err.stderr === "string"
|
: typeof err.stderr === "string"
|
||||||
? err.stderr
|
? err.stderr
|
||||||
|
|||||||
Reference in New Issue
Block a user