MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / makeErrorPayload

Function makeErrorPayload

packages/agent-core/src/errors/serialize.ts:41–53  ·  view source on GitHub ↗
(
  code: KimiErrorCode,
  message: string,
  options?: { readonly details?: Record<string, unknown>; readonly name?: string },
)

Source from the content-addressed store, hash-verified

39 * KIMI_ERROR_INFO so callers cannot drift out of sync with the registry.
40 */
41export 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.

Callers 6

requestApprovalFunction · 0.90
requestQuestionFunction · 0.90
emitRecordsWriteErrorMethod · 0.90
launchMethod · 0.90
emitMcpToolCollisionsMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected