Proper way to inform the user of error on server action

lets assume that there is a server action with multiple insert in if condition . and on one of there inserts there was a database error.
what is the correct way to set an error text and pass it to the client

Community Page
Last updated: