(source: unknown)
| 275 | } |
| 276 | |
| 277 | function formatDetailedRequestError(source: unknown): string | undefined { |
| 278 | const record = asRecord(source) |
| 279 | if (!record) |
| 280 | return undefined |
| 281 | |
| 282 | const code = stringValue(record.code) |
| 283 | const syscall = stringValue(record.syscall) |
| 284 | const hostPort = formatHostPort(record) |
| 285 | |
| 286 | if (code && hostPort) |
| 287 | return [syscall, code, hostPort].filter(Boolean).join(' ') |
| 288 | |
| 289 | return undefined |
| 290 | } |
| 291 | |
| 292 | function getErrorMessage(error: unknown): string | undefined { |
| 293 | return stringValue(asRecord(error)?.message) |
no test coverage detected