rdR
tRPC3y 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 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?

Thanks!
Was this page helpful?