Files
OmniRoute/bin/cli/utils/formatCliError.mjs
Bl0ck a5edffa0af fix(cli): allow opt-in stack traces for command failures (#19590)
Validated in the full merge-train on the .113 (lot 3c, 2026-11-11): typecheck, static gates and the full unit suite. Every failure from that run was re-run in isolation, both on the merged tree and on the train base. They come from the .113 root environment, load-sensitive timing, or known flakes. None trace back to this change.

Co-authored-by: Bl0ck <36800583+Bl0ck154@users.noreply.github.com>
2026-11-11 23:15:41 -03:00

9 lines
384 B
JavaScript

/**
* Keep routine CLI failures readable. Operators can opt into stack traces
* locally with OMNIROUTE_DEBUG_STACK=1 when diagnosing unexpected failures.
*/
export function formatCliError(error, showStack = process.env.OMNIROUTE_DEBUG_STACK === "1") {
const message = error?.message || String(error);
return showStack && error?.stack ? String(error.stack) : String(message);
}