tRPCttRPC
Powered by
aryzingA
tRPCβ€’3y agoβ€’
5 replies
aryzing

What's the negative code returned in error responses?

What's the negative error code returned in errors responses and how is it meant to be used by the client?
Solution
tRPC is compliant with JSON-RPC and has specific error codes. You can find them here;
The docs have a great explanation on handling errors.
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.
Error Handling | tRPC
GitHub
trpc/packages/server/src/rpc/codes.ts at 43e0da13073c8e5426c4c4fb6c...
πŸ§™β€β™€οΈ Move Fast and Break Nothing. End-to-end typesafe APIs made easy. - trpc/trpc
trpc/packages/server/src/rpc/codes.ts at 43e0da13073c8e5426c4c4fb6c...
Jump to solution
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

How to make typed error responses in the context of a specific query?
aryzingAaryzing / ❓-help
3y ago
gzip responses
crummyCcrummy / ❓-help
2y ago
What's the type of errorFormatter parameter
AezralAAezral / ❓-help
3y ago
What is the mutation error type?
Answer OverflowAAnswer Overflow / ❓-help
3y ago