chore: capture operator failure detail in result warnings under debug
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user