MCPcopy Index your code
hub / github.com/callstack/agent-device / toDaemonHttpRpcError

Function toDaemonHttpRpcError

src/daemon/client/daemon-client-rpc.ts:62–78  ·  view source on GitHub ↗
(
  error: { message?: string; data?: Record<string, unknown> },
  requestId: string | undefined,
)

Source from the content-addressed store, hash-verified

60}
61
62function toDaemonHttpRpcError(
63 error: { message?: string; data?: Record<string, unknown> },
64 requestId: string | undefined,
65): AppError {
66 const data = error.data ?? {};
67 return new AppError(
68 toAppErrorCode(data.code != null ? String(data.code) : undefined, 'COMMAND_FAILED'),
69 String(data.message ?? error.message ?? 'Daemon RPC request failed'),
70 {
71 ...(typeof data.details === 'object' && data.details ? data.details : {}),
72 hint: typeof data.hint === 'string' ? data.hint : undefined,
73 diagnosticId: typeof data.diagnosticId === 'string' ? data.diagnosticId : undefined,
74 logPath: typeof data.logPath === 'string' ? data.logPath : undefined,
75 requestId,
76 },
77 );
78}
79
80async function resolveDaemonHttpResult(
81 info: DaemonInfo,

Callers 1

Calls 1

toAppErrorCodeFunction · 0.90

Tested by

no test coverage detected