diff --git a/packages/dsh-plugin-browserskill/src/runner.ts b/packages/dsh-plugin-browserskill/src/runner.ts index 7a2dca7..023e2f0 100644 --- a/packages/dsh-plugin-browserskill/src/runner.ts +++ b/packages/dsh-plugin-browserskill/src/runner.ts @@ -187,6 +187,11 @@ export function parseBskJson(result: BskRunResult, commandLabel: string): unknow throw new BskError(`bsk ${commandLabel} timed out`, { timedOut: true }); } const body = result.stdout.trim(); + // Killed by our own interrupt (SIGTERM from killFor), not by the abort path: + // say so instead of doubling the generic label into the message. + if (result.code === null && !result.aborted && !result.timedOut) { + throw new BskError(`bsk ${commandLabel} was interrupted (process killed)`); + } if (result.code !== 0) { let parsed: BskErrorBody | undefined; try { diff --git a/packages/dsh-plugin-browserskill/tests/runner.test.ts b/packages/dsh-plugin-browserskill/tests/runner.test.ts index dabe046..52d3dac 100644 --- a/packages/dsh-plugin-browserskill/tests/runner.test.ts +++ b/packages/dsh-plugin-browserskill/tests/runner.test.ts @@ -117,6 +117,10 @@ describe("parseBskJson", () => { expect(() => parseBskJson({ ...base, code: 1, stderr: "boom" }, "x")).toThrow(/boom/); }); + it("reports killed-by-interrupt children (null exit code) as interrupted", () => { + expect(() => parseBskJson({ ...base, code: null }, "navigate")).toThrow(/interrupted/); + }); + it("reports timeouts distinctly", () => { expect(() => parseBskJson({ ...base, timedOut: true }, "x")).toThrow(/timed out/); });