(error: unknown)
| 1024 | } |
| 1025 | |
| 1026 | function isRetryableStreamError(error: unknown): boolean { |
| 1027 | if (error instanceof DOMException && error.name === 'AbortError') { |
| 1028 | return false |
| 1029 | } |
| 1030 | if (error instanceof CopilotBackendError) { |
| 1031 | return error.status !== undefined && error.status >= 500 |
| 1032 | } |
| 1033 | if (error instanceof TypeError) { |
| 1034 | return true |
| 1035 | } |
| 1036 | return false |
| 1037 | } |
| 1038 | |
| 1039 | function sleepWithAbort(ms: number, abortSignal?: AbortSignal): Promise<void> { |
| 1040 | if (!abortSignal) { |
no outgoing calls
no test coverage detected