(error: Error)
| 13 | export const PROMPTFOO_TEAM_ID_HEADER = 'x-promptfoo-team-id'; |
| 14 | |
| 15 | function 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`. */ |
| 25 | export function getRequestUrlString(url: string | URL | Request): string { |
no outgoing calls
no test coverage detected
searching dependent graphs…