MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / buildTrpcErrorResponse

Function buildTrpcErrorResponse

services/cloud-agent-next/src/trpc-error.ts:93–110  ·  view source on GitHub ↗
(status: number, message: string, path?: string)

Source from the content-addressed store, hash-verified

91 retryable: clientError.retryable,
92 clientError,
93 ...(billingFailure ? { billingFailure } : {}),
94 };
95 }
96 return {
97 ...data,
98 clientError: createClientError(data.code, message),
99 ...(billingFailure ? { billingFailure } : {}),
100 };
101}
102
103type BuildTrpcErrorResponseOptions = { retryable?: boolean };
104
105export function buildTrpcErrorResponse(
106 status: number,
107 message: string,
108 path?: string,
109 options: BuildTrpcErrorResponseOptions = {}
110): Response {
111 const code =
112 STATUS_TO_TRPC_CODE[status as keyof typeof STATUS_TO_TRPC_CODE] ?? 'INTERNAL_SERVER_ERROR';
113 const data = projectTrpcErrorData({ code, httpStatus: status, path }, message);

Callers 3

trpc-error.test.tsFile · 0.85
auth.tsFile · 0.85
balance.tsFile · 0.85

Calls 1

projectTrpcErrorDataFunction · 0.85

Tested by

no test coverage detected