tRPC onError
I am using tRPC with Fastify and would like to be able to report issues when we get an error.
https://trpc.io/docs/server/error-handling#handling-errors
It mentions we have a onError function, but I only see it inside:
createNextApiHandler
How can I get access to this not using Next? Am I just missing something?
Error Handling | tRPC
Whenever an error occurs in a procedure, tRPC responds to the client with an object that includes an "error" property. This property contains all the information that you need to handle the error in the client.
A
arn4v•367d ago
Most (if not all, not sure) server options are the same across all adapters. You can access it when you create the trpc middleware (in case of express) or register the trpc plugin (in case of fastify).
M
Mugetsu•365d ago
OnError handler should be setup with your Fastify adapter for tRPC.
https://trpc.io/docs/server/adapters/fastify#create-fastify-server
J
joe_and_duke•363d ago
Thanks, missed that!
4.8KMembers
View on DiscordMore Posts
Code structure for a large monorepo using nx + tRPCWe have a large monorepo with a single tRPC API that will be used by several web clients and other cDoes tRPC work with Clerk and Vercel Edge functions?So the answer is yes, at least locally, but I when I deploy to Vercel I get nothing. Trying to work TRPCClientError when creating a db entry without `updatedAt` value?Guys, this is my prisma schema:
```
model User {
id Int @id @default(autoincrement())
Type error: The inferred type of 'trpc' cannot be named without a reference....```./src/lib/api.ts:21:14
@driveorg/dashboard:build: Type error: The inferred type of 'trpc' cannot Decision on authI am using create-t3-app for my app , with next-auth (twitter, discord, google) . Now i am using samWhy does this starter with Prisma have it's own postinstall script?Prisma has it's own postinstall hook/script: <https://www.prisma.io/docs/concepts/components/prisma-Senior Full Stack Developer is Ready.✍️ Skill Set
HTML/CSS/JS, TS
React/Next.js, Angular/RxJs, Tailwind CSS
WordPHow to pass context to vanilla client?Hi,
I have a next app where I use trpc. Now I need to call some trpc functions from outside of any