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

Function parseExplicitLegacyCause

services/cloud-agent-next/src/trpc-error.ts:51–62  ·  view source on GitHub ↗
(cause: unknown)

Source from the content-addressed store, hash-verified

49 retryable: boolean;
50};
51
52function parseExplicitLegacyCause(cause: unknown): ExplicitLegacyCause | undefined {
53 if (!cause || typeof cause !== 'object') return undefined;
54 if (!('error' in cause) || !('retryable' in cause)) return undefined;
55 const parsedError = PublicErrorCodeSchema.safeParse(cause.error);
56 if (!parsedError.success || typeof cause.retryable !== 'boolean') {
57 return undefined;
58 }
59 if ('message' in cause && cause.message !== undefined && typeof cause.message !== 'string') {
60 return undefined;
61 }
62 return { error: parsedError.data, retryable: cause.retryable };
63}
64
65function parseBillingFailure(cause: unknown) {

Callers 1

projectTrpcErrorDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected