MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / logMCPErrorImpl

Function logMCPErrorImpl

source code/utils/errorLogSink.ts:181–197  ·  view source on GitHub ↗

* Implementation for logMCPError - writes MCP error to debug log and file.

(serverName: string, error: unknown)

Source from the content-addressed store, hash-verified

179 * Implementation for logMCPError - writes MCP error to debug log and file.
180 */
181function logMCPErrorImpl(serverName: string, error: unknown): void {
182 // Not themed, to avoid having to pipe theme all the way down
183 logForDebugging(`MCP server "${serverName}" ${error}`, { level: 'error' })
184
185 const logFile = getMCPLogsPath(serverName)
186 const errorStr =
187 error instanceof Error ? error.stack || error.message : String(error)
188
189 const errorInfo = {
190 error: errorStr,
191 timestamp: new Date().toISOString(),
192 sessionId: getSessionId(),
193 cwd: getFsImplementation().cwd(),
194 }
195
196 getLogWriter(logFile).write(errorInfo)
197}
198
199/**
200 * Implementation for logMCPDebug - writes MCP debug message to log file.

Callers

nothing calls this directly

Calls 6

logForDebuggingFunction · 0.85
getMCPLogsPathFunction · 0.85
getSessionIdFunction · 0.85
getFsImplementationFunction · 0.85
getLogWriterFunction · 0.85
writeMethod · 0.45

Tested by

no test coverage detected