How to display text of response?

Good afternoon.

In server actions, I have created an object “Response” with Status 501 and Text “Error email”.
On the client side I run this server action on a form and if error occurs I would like to display that text (“Error email”).
But when error occurs, I always get “Internal server Error”.

Server Action:

Client Side:

Best Regards.

Community Page
Last updated: