MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / errorFormatter

Function errorFormatter

packages/trpc/src/trpc.ts:65–74  ·  view source on GitHub ↗
({ shape, error })

Source from the content-addressed store, hash-verified

63const t = initTRPC.context<Context>().create({
64 transformer: superjson,
65 errorFormatter({ shape, error }) {
66 return {
67 ...shape,
68 data: {
69 ...shape.data,
70 zodError:
71 error.cause instanceof ZodError ? z.flattenError(error.cause) : null,
72 },
73 };
74 },
75});
76
77const enforceUserIsAuthed = t.middleware(async ({ ctx, next }) => {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected