MCPcopy Create free account
hub / github.com/Elliott-Chong/normalhuman / errorFormatter

Function errorFormatter

src/server/api/trpc.ts:46–55  ·  view source on GitHub ↗
({ shape, error })

Source from the content-addressed store, hash-verified

44const t = initTRPC.context<typeof createTRPCContext>().create({
45 transformer: superjson,
46 errorFormatter({ shape, error }) {
47 return {
48 ...shape,
49 data: {
50 ...shape.data,
51 zodError:
52 error.cause instanceof ZodError ? error.cause.flatten() : null,
53 },
54 };
55 },
56});
57
58/**

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected