chore: surface child failure detail under P2_CHILD_DEBUG
This commit is contained in:
@@ -135,7 +135,12 @@ export async function runWorkspaceMaintenanceCli(
|
||||
try { return JSON.parse(io.stdin).workspaceId ?? ""; } catch { return ""; }
|
||||
})());
|
||||
io.writeStdout(boundedJson(result));
|
||||
io.writeStderr(sanitizeStderr(error));
|
||||
if (process.env.P2_CHILD_DEBUG === "1") {
|
||||
const detail = String((error as Error).message ?? "").replace(/[\r\n]+/g, " ").slice(0, 2048);
|
||||
io.writeStderr(`workspace maintenance failed: ${detail}\n`);
|
||||
} else {
|
||||
io.writeStderr(sanitizeStderr(error));
|
||||
}
|
||||
const message = String((error as Error).message ?? "");
|
||||
const requestError = error instanceof SyntaxError
|
||||
|| message === "invalid request"
|
||||
|
||||
Reference in New Issue
Block a user