MCPcopy Create free account
hub / github.com/OpenPipe/OpenPipe / standardResponseShape

Function standardResponseShape

app/src/utils/errorHandling/standardResponses.ts:15–26  ·  view source on GitHub ↗
(payloadShape = z.undefined() as T)

Source from the content-addressed store, hash-verified

13}
14
15export function standardResponseShape<T extends ZodTypeAny>(payloadShape = z.undefined() as T) {
16 return z.union([
17 z.object({
18 status: z.literal("success"),
19 payload: payloadShape,
20 }),
21 z.object({
22 status: z.literal("error"),
23 message: z.string(),
24 }),
25 ]);
26}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected