mirror of
https://github.com/morluto/rea.git
synced 2026-11-19 05:02:40 +00:00
feat(errors): carry related parameters and operations and derive CLI flags and commands (#11777)
* feat(errors): carry related parameters and operations and derive CLI flags and commands * fix(cli,errors): preserve operation-selector flags in CLI hints and clarify snapshot load/save
This commit is contained in:
1 parent
ddd0d6d4a4
commit
d5a942177f
25 files changed
+679
-68
No files matched your search
@@ -96,6 +96,19 @@ export const cliOperationFailureIdentity = (
|
||||
): CliFailureIdentity | undefined =>
|
||||
isRecord(value) ? loggedFailures.get(value)?.identity : undefined;
|
||||
|
||||
/** Keep failure classification and recovery identity when a CLI wrapper projects an error record. */
|
||||
export const rebindLoggedCliFailure = (
|
||||
previous: unknown,
|
||||
next: unknown,
|
||||
): void => {
|
||||
if (previous === next || !isRecord(previous) || !isRecord(next)) return;
|
||||
if (!loggedFailures.has(previous)) return;
|
||||
loggedFailures.set(
|
||||
next,
|
||||
inferCliOperationFailure(next) ?? loggedFailures.get(previous),
|
||||
);
|
||||
};
|
||||
|
||||
/** Log one CLI command with duration and a stable success or failure status. */
|
||||
export const logCliCommand = async <Value>(
|
||||
logger: Logger,
|
||||
|
||||
Reference in new issue
Block a user