const t = initTRPC.context<typeof createTRPCContext>().create({
transformer: superjson,
errorFormatter({ shape, error }) {
if (error instanceof MyAppError) {
return {
...shape,
data: {
...shape.data,
details: error.details,
},
};
}
return shape;
},
});
const t = initTRPC.context<typeof createTRPCContext>().create({
transformer: superjson,
errorFormatter({ shape, error }) {
if (error instanceof MyAppError) {
return {
...shape,
data: {
...shape.data,
details: error.details,
},
};
}
return shape;
},
});