#server function error handling

4 messages · Page 1 of 1 (latest)

frigid grotto
#

Uncaught errors are handled with the ErrorBoundary component.
But inside server functions you can catch handle the error yourself.

#

That is related to your rpc.
What is that doing?
And if you are modifying data in a db you should probably use an action instead of query

frail iris
#

try {
return myAction()
} catch {
return new Response(…)
}

#

you could just return a response and set any status code you wnat