chore: capture operator failure detail in result warnings under debug

This commit is contained in:
2026-08-11 19:56:40 +02:00
parent 79e592894d
commit e197ba1fd4
+4
View File
@@ -134,6 +134,10 @@ export async function runWorkspaceMaintenanceCli(
const result = failureResult(command, (() => { const result = failureResult(command, (() => {
try { return JSON.parse(io.stdin).workspaceId ?? ""; } catch { return ""; } try { return JSON.parse(io.stdin).workspaceId ?? ""; } catch { return ""; }
})()); })());
if (process.env.P2_CHILD_DEBUG === "1") {
const detail = String((error as Error).message ?? "").replace(/[\r\n]+/g, " ").slice(0, 2048);
result.warnings = detail.length > 0 ? [detail] : undefined;
}
io.writeStdout(boundedJson(result)); io.writeStdout(boundedJson(result));
if (process.env.P2_CHILD_DEBUG === "1") { if (process.env.P2_CHILD_DEBUG === "1") {
const detail = String((error as Error).message ?? "").replace(/[\r\n]+/g, " ").slice(0, 2048); const detail = String((error as Error).message ?? "").replace(/[\r\n]+/g, " ").slice(0, 2048);