MCPcopy Create free account
hub / github.com/codeaashu/claude-code / isTerminalConnectionError

Function isTerminalConnectionError

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

Source from the content-addressed store, hash-verified

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

Callers 1

client.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected