fix(artifacts): preserve reader failure diagnostics (#987)
* fix(artifacts): preserve filesystem and DMG diagnostics * fix(artifacts): classify DMG verification failures * fix(artifacts): distinguish inaccessible disk images * fix(artifacts): classify damaged image checksums
This commit is contained in:
@@ -23,4 +23,13 @@ describe("execFileOutput", () => {
|
||||
),
|
||||
).rejects.toMatchObject({ code: "ERR_CHILD_PROCESS_STDIO_MAXBUFFER" });
|
||||
});
|
||||
|
||||
it("retains both captured streams on a failed child process", async () => {
|
||||
await expect(
|
||||
execFileOutput(process.execPath, [
|
||||
"-e",
|
||||
'process.stdout.write("out"); process.stderr.write("err"); process.exitCode = 7;',
|
||||
]),
|
||||
).rejects.toMatchObject({ code: 7, stdout: "out", stderr: "err" });
|
||||
});
|
||||
});
|
||||
|
||||
@@ -25,6 +25,8 @@ export const execFileOutput = (
|
||||
},
|
||||
(error, stdout, stderr) => {
|
||||
if (error !== null) {
|
||||
Reflect.set(error, "stdout", stdout);
|
||||
Reflect.set(error, "stderr", stderr);
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user