(cause: unknown)
| 49 | retryable: boolean; |
| 50 | }; |
| 51 | |
| 52 | function parseExplicitLegacyCause(cause: unknown): ExplicitLegacyCause | undefined { |
| 53 | if (!cause || typeof cause !== 'object') return undefined; |
| 54 | if (!('error' in cause) || !('retryable' in cause)) return undefined; |
| 55 | const parsedError = PublicErrorCodeSchema.safeParse(cause.error); |
| 56 | if (!parsedError.success || typeof cause.retryable !== 'boolean') { |
| 57 | return undefined; |
| 58 | } |
| 59 | if ('message' in cause && cause.message !== undefined && typeof cause.message !== 'string') { |
| 60 | return undefined; |
| 61 | } |
| 62 | return { error: parsedError.data, retryable: cause.retryable }; |
| 63 | } |
| 64 | |
| 65 | function parseBillingFailure(cause: unknown) { |
no outgoing calls
no test coverage detected