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

Function onUnhandledRejection

apps/kimi-code/src/cli/run-shell.ts:173–180  ·  view source on GitHub ↗
(reason: unknown)

Source from the content-addressed store, hash-verified

171 emergencyExit(1);
172 };
173 const onUnhandledRejection = (reason: unknown): void => {
174 try {
175 log.error('unhandledRejection, restoring terminal and exiting', { reason: String(reason) });
176 } catch {
177 /* ignore */
178 }
179 emergencyExit(1);
180 };
181 process.on('uncaughtException', onUncaughtException);
182 process.on('unhandledRejection', onUnhandledRejection);
183 // Remove the crash handlers once the TUI exits cleanly so repeated runShell()

Callers

nothing calls this directly

Calls 2

emergencyExitFunction · 0.85
errorMethod · 0.65

Tested by

no test coverage detected