(message: string, code: string, cause?: unknown)
| 3 | import { formatAPIError, getSSLErrorHint } from './errorUtils.js' |
| 4 | |
| 5 | function withCode(message: string, code: string, cause?: unknown): Error { |
| 6 | const error = new Error(message, cause ? { cause } : undefined) as Error & { |
| 7 | code?: string |
| 8 | } |
| 9 | error.code = code |
| 10 | return error |
| 11 | } |
| 12 | |
| 13 | function createApiError( |
| 14 | message: string | undefined, |