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

Function isTransientError

src/services/oauth/client.ts:157–172  ·  view source on GitHub ↗
(error: unknown)

Source from the content-addressed store, hash-verified

155}
156
157function isTransientError(error: unknown): boolean {
158 if (!axios.isAxiosError(error)) {
159 return false
160 }
161 const code = error.code
162 if (
163 code === 'ECONNABORTED' ||
164 code === 'ETIMEDOUT' ||
165 code === 'ECONNRESET' ||
166 code === 'ENOTFOUND'
167 ) {
168 return true
169 }
170 const status = error.response?.status ?? 0
171 return status >= 500 || status === 429
172}
173
174async function withTransientRetry<T>(
175 fn: () => Promise<T>,

Callers 1

withTransientRetryFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected