MCPcopy
hub / github.com/OpenCoworkAI/open-codesign / isTransportLevelError

Function isTransportLevelError

packages/providers/src/retry.ts:120–130  ·  view source on GitHub ↗
(errorMessage: string | undefined)

Source from the content-addressed store, hash-verified

118}
119
120export function isTransportLevelError(errorMessage: string | undefined): boolean {
121 if (!errorMessage) return false;
122 const message = normalizeErrorText(errorMessage);
123 return (
124 includesWord(message, 'terminated') ||
125 message.includes('premature close') ||
126 message.includes('stream ended') ||
127 message.includes('stream closed') ||
128 message.includes('econnreset')
129 );
130}
131
132export function isProviderAbortedTransportError(errorMessage: string | undefined): boolean {
133 if (!errorMessage) return false;

Callers 2

generateViaAgentFunction · 0.90
classifyByNetworkFunction · 0.85

Calls 2

normalizeErrorTextFunction · 0.85
includesWordFunction · 0.85

Tested by

no test coverage detected