TanStackT
TanStack11mo ago
10 replies
urgent-maroon

Global Error handler in start?

I have an issue where I am throwing errors from some server functions but when I try to catch them in the client I don't have a good way to actually identify if the error is okay to display to the user because I threw it or if its caused by something I don't want to expose.

Generally in an API you would have a custom error class and a global error handler that catches all errors and returns a generic error for all errors that are not instances of your custom error class. Is there a way to do something similar in Start? Or can I solve this issue a different way?

To be as clear as possible what I want is to be able to send errors from my server functions and have the client display them. But I want to send/display a generic error for anything unexpected and send/display more informative errors otherwise
Was this page helpful?