MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / onUnhandledRejection

Function onUnhandledRejection

apps/cli/src/commands/cli/run.ts:439–458  ·  view source on GitHub ↗
(reason: unknown)

Source from the content-addressed store, hash-verified

437 }
438
439 const onUnhandledRejection = (reason: unknown) => {
440 if (
441 isExpectedControlFlowError(reason, {
442 stdinStreamMode: useStdinPromptStream,
443 shuttingDown: isShuttingDown,
444 operation: "runtime",
445 })
446 ) {
447 return
448 }
449
450 const error = normalizeError(reason)
451 emitRuntimeError(error, "unhandledRejection")
452
453 if (signalOnlyExit) {
454 return
455 }
456
457 void shutdown("unhandledRejection", 1)
458 }
459
460 const parkUntilSignal = async (reason: string): Promise<never> => {
461 ensureKeepAliveInterval()

Callers

nothing calls this directly

Calls 4

normalizeErrorFunction · 0.85
emitRuntimeErrorFunction · 0.85
shutdownFunction · 0.70

Tested by

no test coverage detected