(error: unknown)
| 484 | } |
| 485 | |
| 486 | function classifyConnectionTestError(error: unknown): ConnectionEffectError { |
| 487 | if (error instanceof ConnectionEffectFetchError) return { kind: error.kind }; |
| 488 | if (error instanceof ConnectionEffectHttpError) { |
| 489 | return classifyConnectionEffectStatus(error.status); |
| 490 | } |
| 491 | if (error instanceof ConnectionEffectInvalidResponseError || error instanceof SyntaxError) { |
| 492 | return { kind: 'invalid_response' }; |
| 493 | } |
| 494 | return { kind: 'unknown' }; |
| 495 | } |
| 496 | |
| 497 | function classifyConnectionTestResult(result: ConnectionTestResult): ConnectionEffectError { |
| 498 | if (result.statusCode !== undefined) { |
no test coverage detected