Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/Aquaticat/Monochromatic. TypeScript and Rust monorepo: Claude Code and Pi coding-agent plugins, a m
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798import { caughtValueText, } from '@monochromatic-dev/module-caught-value/ts';
/** Renders caught cause without retaining mutable foreign object. @param cause - optional underlying failure @returns empty suffix or plain caught message @example ```ts causeSuffix(new Error('failure')); // => ' Cause: failure' ``` */function causeSuffix(cause?: unknown,): string { if (cause === undefined) return ''; return ` Cause: ${caughtValueText(cause,)}`;}
/** Filesystem or repository failure while synchronizing ignored worktree state. @example ```ts throw new WorktreeCopyError('cli-git: could not copy ignored state.'); ``` */export class WorktreeCopyError extends Error { /** Creates typed worktree-copy failure. @param message - complete user-facing diagnostic @param cause - underlying filesystem or Git failure */ public constructor( message: string, cause?: unknown, ) { super(`${message}${causeSuffix(cause,)}`,); this.name = 'WorktreeCopyError'; }}
/** Combined failure preserving real Git status after ignored-state copying also failed. @example ```ts throw new ForwardedGitWorktreeCopyError({ copyFailureMessage: 'copy failed', gitFailure: { exitCode: 1 }, }); ``` */export class ForwardedGitWorktreeCopyError extends Error { /** User-facing copy failure diagnostic. */ public readonly copyFailureMessage: string;
/** Real Git failed before copy settlement. */ public readonly gitFailed: boolean;
/** Real-Git numeric exit status when process exited normally. */ public readonly gitFailureExitCode?: number;
/** Creates combined lifecycle failure without retaining mutable subprocess errors. @param copyFailureMessage - ignored-state synchronization diagnostic @param gitFailure - optional primitive real-Git failure details */ public constructor({ copyFailureMessage, gitFailure, }: Readonly<{ copyFailureMessage: string; gitFailure?: Readonly<{ exitCode?: number; }>; }>,) { super(copyFailureMessage,); this.name = 'ForwardedGitWorktreeCopyError'; this.copyFailureMessage = copyFailureMessage; this.gitFailed = gitFailure !== undefined; if (gitFailure?.exitCode !== undefined) this.gitFailureExitCode = gitFailure.exitCode; }}