MCPcopy Index your code
hub / github.com/promptfoo/promptfoo / isConnectionError

Function isConnectionError

src/util/fetch/monkeyPatchFetch.ts:15–22  ·  view source on GitHub ↗
(error: Error)

Source from the content-addressed store, hash-verified

13export const PROMPTFOO_TEAM_ID_HEADER = 'x-promptfoo-team-id';
14
15function isConnectionError(error: Error) {
16 return (
17 error instanceof TypeError &&
18 error.message === 'fetch failed' &&
19 // @ts-expect-error undici error cause
20 error.cause?.stack?.includes('internalConnectMultiple')
21 );
22}
23
24/** Extracts the request URL as a string. A `Request`'s `toString()` is "[object Request]", so read `.url`. */
25export function getRequestUrlString(url: string | URL | Request): string {

Callers 1

monkeyPatchFetchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…