tRPCttRPC
Powered by
rdR
tRPC•3y ago•
7 replies
rd

Error Handling vs Error Formatting

I'm a bit confused from the docs about how I should be handling errors on the server. The Error Handling section refers to handling errors client side right?

More specifically, the ORM I'm using suggests delegating error handling to the server implementation. Where the ORM is throwing an instance of its internal
NotFoundError
NotFoundError
class, I need to update the response http code to 404 and also hide the data associated with that error in production. Should I be doing this within the
errorFormatter
errorFormatter
?

Thanks!
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

trpc error formatting
v28Vv28 / ❓-help
2mo ago
Zod formatting Error
Nacho EliasNNacho Elias / ❓-help
2y ago
error handling
SzymonSSzymon / ❓-help
13mo ago
Error handling
TkDodo 🔮TTkDodo 🔮 / ❓-help
4y ago