(code: string, message: string, retryable?: boolean)
| 62 | return { error: parsedError.data, retryable: cause.retryable }; |
| 63 | } |
| 64 | |
| 65 | function parseBillingFailure(cause: unknown) { |
| 66 | if (!cause || typeof cause !== 'object' || !('billingFailure' in cause)) return undefined; |
| 67 | const parsed = customerBillingFailureSchema.safeParse(cause.billingFailure); |
| 68 | return parsed.success ? parsed.data : undefined; |
| 69 | } |
| 70 | |
| 71 | export function createClientError(code: string, message: string, retryable?: boolean): ClientError { |
| 72 | return { |
| 73 | code, |
no test coverage detected