MCPcopy Create free account
hub / github.com/Noumena-Network/code / closeTransportAndRejectPending

Function closeTransportAndRejectPending

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

Source from the content-addressed store, hash-verified

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

Callers 1

client.tsFile · 0.85

Calls 3

logMCPDebugFunction · 0.85
errorMessageFunction · 0.50
closeMethod · 0.45

Tested by

no test coverage detected