Show server error on client
Answered
West African Lion posted this in #help-forum
West African LionOP
I know there are other threads for this but I have yet to find a proper solution. Is there currently no way to disable this behaviour?
Returning a successful response with error field is not a good solution as this will also not work with errorboundary
Returning a successful response with error field is not a good solution as this will also not work with errorboundary
Answered by West African Lion
yeah I think that might be to optimal solution here. I opted for a weird one since I didn't want to rewrite much.
then in my boundary or anywhere else I call getPublicErrorMessage()
then in my boundary or anywhere else I call getPublicErrorMessage()
2 Replies
@West African Lion I know there are other threads for this but I have yet to find a proper solution. Is there currently no way to disable this behaviour?
Returning a successful response with error field is not a good solution as this will also not work with errorboundary
I like to use next-safe-action also because of the error handling, that you need in this case: https://next-safe-action.dev/docs/safe-action-client/custom-server-error-handling
What do you think?
What do you think?
West African LionOP
yeah I think that might be to optimal solution here. I opted for a weird one since I didn't want to rewrite much.
then in my boundary or anywhere else I call getPublicErrorMessage()
then in my boundary or anywhere else I call getPublicErrorMessage()
Answer