(
code: KimiErrorCode,
message: string,
options?: { readonly details?: Record<string, unknown>; readonly name?: string },
)
| 39 | * KIMI_ERROR_INFO so callers cannot drift out of sync with the registry. |
| 40 | */ |
| 41 | export function makeErrorPayload( |
| 42 | code: KimiErrorCode, |
| 43 | message: string, |
| 44 | options?: { readonly details?: Record<string, unknown>; readonly name?: string }, |
| 45 | ): KimiErrorPayload { |
| 46 | return { |
| 47 | code, |
| 48 | message, |
| 49 | name: options?.name, |
| 50 | details: options?.details, |
| 51 | retryable: KIMI_ERROR_INFO[code].retryable, |
| 52 | }; |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * Normalize any value into a KimiErrorPayload. |
no outgoing calls
no test coverage detected