How to extend trpc's default error codes?

I need to add more error codes to make error processing on the front-end easier. I tried adding a trpc.d.ts in the types folder.
import { type TRPCError } from '@trpc/server';

declare module '@trpc/server' {
interface TRPCError {
code: 'TRIPS/SLUG_IN_USE';
}
}
import { type TRPCError } from '@trpc/server';

declare module '@trpc/server' {
interface TRPCError {
code: 'TRIPS/SLUG_IN_USE';
}
}
But it ain't working. How do you usually go about this?
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server