Is trpc returns promise?
I am pretty noobie, accept that. Is trpc returns promise? If it doesnt how do we handle errors?
2 Replies
In the frontend, trpc leverages react query to handle async values. This gives you everything from data to loading states to error states.
in the backend, whenever a procedure throws an error, the response sent to the frontend will include details about the error.
see: https://trpc.io/docs/v10/error-handling
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.
great, thank you