| 10 | } |
| 11 | |
| 12 | export interface ExecuteEndpointFallbackOptions<T> { |
| 13 | configuredEndpoints: string[]; |
| 14 | getRemoteEndpoints?: () => Promise<string[]>; |
| 15 | tryEndpoint: (endpoint: string) => Promise<T>; |
| 16 | random?: () => number; |
| 17 | now?: () => number; |
| 18 | onFirstFailure?: (failure: EndpointAttemptFailure) => void | Promise<void>; |
| 19 | } |
| 20 | |
| 21 | const normalizeError = (error: unknown) => { |
| 22 | if (error instanceof Error) { |
nothing calls this directly
no outgoing calls
no test coverage detected