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

Function isTerminalConnectionError

src/services/mcp/client.ts:1250–1264  ·  view source on GitHub ↗
(msg: string)

Source from the content-addressed store, hash-verified

1248 }
1249
1250 const isTerminalConnectionError = (msg: string): boolean => {
1251 return (
1252 msg.includes('ECONNRESET') ||
1253 msg.includes('ETIMEDOUT') ||
1254 msg.includes('EPIPE') ||
1255 msg.includes('EHOSTUNREACH') ||
1256 msg.includes('ECONNREFUSED') ||
1257 msg.includes('Body Timeout Error') ||
1258 msg.includes('terminated') ||
1259 // SDK SSE reconnection intermediate errors — may be wrapped around the
1260 // actual network error, so the substrings above won't match
1261 msg.includes('SSE stream disconnected') ||
1262 msg.includes('Failed to reconnect SSE stream')
1263 )
1264 }
1265
1266 // Enhanced error handler with detailed logging
1267 client.onerror = (error: Error) => {

Callers 1

client.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected