@isomorph.ai/cli 0.7.2 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -48,6 +48,17 @@ export async function runJob(root, name, scheduledAt, run = runCommand, real = f
|
|
|
48
48
|
const gatewayUrl = real ? lock.origin : `http://127.0.0.1:${lock.ports.gateway}`;
|
|
49
49
|
const result = await run(process.execPath, ["--experimental-strip-types", "--input-type=module", "--eval", runner], { cwd: root, env: { ...env, ISOMORPH_GATEWAY_URL: gatewayUrl, ISOMORPH_SCHEDULED_AT: timestamp } });
|
|
50
50
|
if (result.code !== 0)
|
|
51
|
-
throw new CliError("JOB_FAILED", `Job ${name} failed: ${result.stderr.trim().split("\n").
|
|
51
|
+
throw new CliError("JOB_FAILED", `Job ${name} failed: ${jobFailureReason(result.stderr)}`, undefined, "Fix what the error names in jobs/<name>.ts, then run this again; `details.stderr` carries the last lines.", undefined, { details: { stderr: result.stderr.trim().split("\n").slice(-20) } });
|
|
52
52
|
return { name, schedule: job.schedule, scheduledAt: timestamp, mode: real ? "real" : "local" };
|
|
53
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* The line of a failed job's stderr that says what went wrong. Node prints
|
|
56
|
+
* the stack first and its own version last, so the last line — what this
|
|
57
|
+
* used to report — was `Node.js v24.19.0` ten times in one build (bench
|
|
58
|
+
* s19, 2026-09-16). The first line naming an error wins; failing that, the
|
|
59
|
+
* first non-empty line.
|
|
60
|
+
*/
|
|
61
|
+
export function jobFailureReason(stderr) {
|
|
62
|
+
const lines = stderr.split("\n").map(line => line.trim()).filter(Boolean);
|
|
63
|
+
return lines.find(line => /\b(?:error|exception|failed|cannot|unexpected|invalid|denied|refused)\b/i.test(line)) ?? lines[0] ?? "process exited non-zero";
|
|
64
|
+
}
|