mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 22:17:00 +00:00
17 lines
487 B
JavaScript
17 lines
487 B
JavaScript
// Keeps wrapper failures visible even when preceding diagnostics are truncated.
|
|
export function writeFailedTrailer(tool, exitCode, log = console.error) {
|
|
if (typeof exitCode === "number" && exitCode !== 0) {
|
|
log(`[${tool}] FAILED (exit ${exitCode})`);
|
|
}
|
|
}
|
|
|
|
export async function runWithFailedTrailer(tool, run, log = console.error) {
|
|
try {
|
|
await run();
|
|
} catch (error) {
|
|
log(error);
|
|
process.exitCode = 1;
|
|
}
|
|
writeFailedTrailer(tool, process.exitCode, log);
|
|
}
|