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.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194/** Error raised when command-line arguments do not satisfy the command contract. @example ```ts throw new CliUsageError('Missing required subcommand: up'); ``` */export class CliUsageError extends Error { /** Stable error type name rendered by Node. */ override name = 'CliUsageError';}
/** Error raised when a config file cannot represent a WireGuard interface. @example ```ts throw new ConfigError('Config file does not exist: /etc/wireguard/mx.conf'); ``` */export class ConfigError extends Error { /** Stable error type name rendered by Node. */ override name = 'ConfigError';}
/** Error raised when CLI cannot enter or complete privileged execution. @example ```ts throw new PrivilegeError('Unable to start sudo.'); ``` */export class PrivilegeError extends Error { /** Stable error type name rendered by Node. */ override name = 'PrivilegeError';}
/** Error raised when application bypass state is missing, corrupt, or unsafe to mutate. @example ```ts throw new BypassStateError('Bypass state does not match interface.'); ``` */export class BypassStateError extends Error { /** Stable error type name. */ override name = 'BypassStateError';}
/** Error raised when no physical path can carry exempt traffic. @example ```ts throw new BypassRouteError('No physical default route exists.'); ``` */export class BypassRouteError extends Error { /** Stable error type name. */ override name = 'BypassRouteError';}
/** Error raised when OpenSnitch system-firewall configuration cannot be reconciled safely. @example ```ts throw new OpenSnitchConfigError('OpenSnitch firewall config is malformed.'); ``` */export class OpenSnitchConfigError extends Error { /** Stable error type name rendered by Node. */ override name = 'OpenSnitchConfigError';}
/** Error raised when active OpenSnitch daemon does not converge to persisted rules. @example ```ts throw new OpenSnitchLiveReloadError('OpenSnitch live chain is incomplete.'); ``` */export class OpenSnitchLiveReloadError extends OpenSnitchConfigError { /** Stable error type name rendered by Node. */ override name = 'OpenSnitchLiveReloadError';}
/** Error raised when existing policy routing would override tunnel selection. @example ```ts throw new PolicyRoutingConflictError('Conflicting packet mark is active.'); ``` */export class PolicyRoutingConflictError extends Error { /** Stable error type name rendered by Node. */ override name = 'PolicyRoutingConflictError';}
/** Error raised when an external `ip`, `wg`, or `resolvectl` command exits non-zero. @example ```ts throw new CommandError({ command: 'ip', args: ['link', 'add'], exitCode: 2, stderr: 'RTNETLINK answers: File exists', }); ``` */export class CommandError extends Error { /** Stable error type name rendered by Node. */ override name = 'CommandError';
/** Numeric exit code reported by the failed command. */ readonly exitCode: number;
/** Standard error emitted by the failed command. */ readonly stderr: string;
/** Creates a command failure carrying exit code and captured stderr. @param command - Executable that failed. @param args - Arguments the executable received. @param exitCode - Numeric exit code the executable reported. @param stderr - Standard error the executable emitted. @example ```ts new CommandError({ command: 'ip', args: ['link'], exitCode: 2, stderr: 'x' }); ``` */ public constructor( { command, args, exitCode, stderr, }: { readonly command: string; readonly args: readonly string[]; readonly exitCode: number; readonly stderr: string; }, ) { /** Fresh copy of the argument list so joining never reads a caller-owned array. */ const rendered: readonly string[] = [ ...args, ]; super( `Command failed (${String(exitCode,)}): ${command} ${rendered.join(' ',)}\n${stderr}`, ); this.exitCode = exitCode; this.stderr = stderr; }}