MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / isDeadTerminalError

Function isDeadTerminalError

apps/kimi-code/src/tui/utils/dead-terminal.ts:12–18  ·  view source on GitHub ↗
(error: unknown)

Source from the content-addressed store, hash-verified

10const DEAD_TERMINAL_ERROR_CODES = new Set<string>(['EIO', 'EPIPE', 'ENOTCONN']);
11
12export function isDeadTerminalError(error: unknown): boolean {
13 if (error === null || typeof error !== 'object' || !('code' in error)) {
14 return false;
15 }
16 const code = (error as NodeJS.ErrnoException).code;
17 return code !== undefined && DEAD_TERMINAL_ERROR_CODES.has(code);
18}

Callers 2

terminalErrorHandlerMethod · 0.90

Calls 1

hasMethod · 0.65

Tested by

no test coverage detected