Next.js Discord

Discord Forum

Handling errors from server action

Unanswered
Silver posted this in #help-forum
Open in Discord
SilverOP
I’m looking for a recommended approach in handling server action errors with ShadCN. What I mean is let’s say my API wants to let the user know that the request that they just made was unsuccessful or if there was a error in the request itself.

6 Replies

I recommend you to use https://next-safe-action.dev/
@Silver give it a try! it should be amazing
SilverOP
I’ve seen this before, is it production ready? Do you know any open source examples I can look at for best practices?

Currently in my application, I realized a issue with using server actions with forms where I had to manually bind the form values in the Server action. I wonder if this will be a problem for that. It seems my issue is a common/known one based on some posts I read
@James4u
SilverOP
Thank you!