12 lines
438 B
TypeScript

import type { SpawnError } from "@uncaged/nerve-workflow-utils";
export function formatSpawnFailure(error: SpawnError): string {
if (error.kind === "spawn_failed") {
return `spawn_failed: ${error.message}`;
}
if (error.kind === "timeout") {
return `timeout: stdout=${error.stdout.slice(0, 200)} stderr=${error.stderr.slice(0, 200)}`;
}
return `non_zero_exit(${error.exitCode}): stderr=${error.stderr.slice(0, 400)}`;
}