t
tRPC
D
tRPC
•
10mo ago
•
1 reply
danecando
Best way to wrap procedure for error handling
Wondering what
's the most idiomatic way to accomplish this
?
I want to have a try
{
} catch
{
} that wraps each procedure and returns a generic error for uncaught
(non trpc
) errors
It is to just created a wrapper fn ie
withErrorHandling
withErrorHandling
that you wrap all your procedures with
?
I tried middleware but it doesn
't seem like you can return a different value for the error
.
tRPC
Join
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
Best way to implement input based validation on a router procedure
J
JavascriptMick / ❓-help
3y ago
error handling
S
Szymon / ❓-help
13mo ago