T
tRPC

❓-help

How to use the errorFormatter when using an adapter?

Ttheo.gravity6/12/2023
The example here uses context.create(), which isn't something you do when using an adapter. I don't see an errorFormatter exposed in createExpressMiddleware() https://trpc.io/docs/server/error-formatting
Solution:
Ah, it was a dumb question. It has nothing to do with adapters. ```ts const t = initTRPC.context<OuterContext>().create({ errorFormatter({ shape }) {...
Jump to solution
Solution
Ttheo.gravity6/12/2023
Ah, it was a dumb question. It has nothing to do with adapters.
const t = initTRPC.context<OuterContext>().create({
errorFormatter({ shape }) {

}
});

export const router = t.router;
export const middleware = t.middleware;
export const mergeRouters = t.mergeRouters;
export const procedure = t.procedure;
const t = initTRPC.context<OuterContext>().create({
errorFormatter({ shape }) {

}
});

export const router = t.router;
export const middleware = t.middleware;
export const mergeRouters = t.mergeRouters;
export const procedure = t.procedure;

Looking for more? Join the community!