MCPcopy
hub / github.com/zgsm-ai/costrict / emitRuntimeError

Function emitRuntimeError

apps/cli/src/commands/cli/run.ts:457–468  ·  view source on GitHub ↗
(error: Error, source?: string)

Source from the content-addressed store, hash-verified

455 : null
456
457 const emitRuntimeError = (error: Error, source?: string) => {
458 const errorMessage = source ? `${source}: ${error.message}` : error.message
459
460 if (useJsonOutput) {
461 const errorEvent = { type: "error", id: Date.now(), content: errorMessage }
462 process.stdout.write(JSON.stringify(errorEvent) + "\n")
463 return
464 }
465
466 console.error("[CLI] Error:", errorMessage)
467 console.error(error.stack)
468 }
469
470 const clearKeepAliveInterval = () => {
471 if (!keepAliveInterval) {

Callers 3

onUncaughtExceptionFunction · 0.85
onUnhandledRejectionFunction · 0.85
runFunction · 0.85

Calls 2

writeMethod · 0.65
errorMethod · 0.65

Tested by

no test coverage detected