1. Stale bus host lock refusals from bus status, start, stop and restart name mosaic bus recover ORG. 2. org definitions: unknown org, unknown or malformed name and bad id give one refusal or usage line, no stack trace, no host path. 3. Pack, board and workflow refusals print their hint as template save does; tested with the real CliError transport shape. 4. console start and stop clear a console/start.lock whose named supervisor (pid and start time) is gone; a live or unnamed holder refuses. 5. Template save keeps free text verbatim and writes no placeholders; the preview lists each field that mentions an org-specific name. 6. A request the shim never sent (no socket, connect refused) exits 5 and the CLI reports bus-not-running with the start and recover line. 7. autonomy-precondition carries the check that failed, including on the hire paths. 8. Saving under an existing template name refuses template-exists with a next step; refusal table entry added, channel-proof pins moved.
28 lines
1.1 KiB
JavaScript
28 lines
1.1 KiB
JavaScript
// Exit codes for every `mosaic` command in this package: 0 ok; 1 failed
|
|
// (a child died, a boot timed out, an outcome is unknown); 2 invalid (bad
|
|
// input, a decision or option that doesn't exist); 3 refused (system or
|
|
// business config problem, the broker or notifier refused, the human proof
|
|
// refused, a host already running); 4 usage.
|
|
//
|
|
// E2E6: `next` is an optional next-step line. run() prints it after the message as
|
|
// `mosaic: next: ...`; the message itself stays as callers (the Console among them) match it.
|
|
export class CliError extends Error {
|
|
constructor(message, exitCode = 2, { next } = {}) {
|
|
super(message);
|
|
this.name = "CliError";
|
|
this.exitCode = exitCode;
|
|
if (typeof next === "string" && next !== "") this.next = next;
|
|
}
|
|
}
|
|
|
|
// Rename r2 stage B: `mosaic org config validate|resolve` writes its own messages
|
|
// (packages/organization/src/config-command.mjs) and then ends with this exit code; run()
|
|
// returns it without printing anything more.
|
|
export class CliExit extends Error {
|
|
constructor(exitCode) {
|
|
super(`exit ${exitCode}`);
|
|
this.name = "CliExit";
|
|
this.exitCode = exitCode;
|
|
}
|
|
}
|