(
error: { message?: string; data?: Record<string, unknown> },
requestId: string | undefined,
)
| 60 | } |
| 61 | |
| 62 | function 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 | |
| 80 | async function resolveDaemonHttpResult( |
| 81 | info: DaemonInfo, |
no test coverage detected