MCPcopy Index your code
hub / github.com/codeaashu/claude-code / closeTransportAndRejectPending

Function closeTransportAndRejectPending

src/services/mcp/client.ts:1240–1247  ·  view source on GitHub ↗
(reason: string)

Source from the content-addressed store, hash-verified

1238 // Calling client.onclose?.() directly would only clear the cache — pending
1239 // tool calls would stay hung.
1240 const closeTransportAndRejectPending = (reason: string) => {
1241 if (hasTriggeredClose) return
1242 hasTriggeredClose = true
1243 logMCPDebug(name, `Closing transport (${reason})`)
1244 void client.close().catch(e => {
1245 logMCPDebug(name, `Error during close: ${errorMessage(e)}`)
1246 })
1247 }
1248
1249 const isTerminalConnectionError = (msg: string): boolean => {
1250 return (

Callers 1

client.tsFile · 0.85

Calls 3

logMCPDebugFunction · 0.85
errorMessageFunction · 0.50
closeMethod · 0.45

Tested by

no test coverage detected