How Do I Prevent a Server Action Stopping When An External API Call Fails?

I have a Server Action which calls an external API to send an email.

If there is a problem sending the email, the external API appears to sends back an error HTTP response which then makes my server action stop. So for example, I am seeing in the Network console of the browser when the server action runs:

ErrorCode: 400,…}
ErrorCode: 400
Message: "The 'From' address you supplied (antony1@workshop-angel.com) is not a Sender Signature on your account. Please add and confirm this address in order to be able to use it in the 'From' field of your messages."

What do I have to do in my Server Action to make it continue and allow me to capture this error information to display to my user?

Uncheck the Pass Errors

image

2 Likes

Thanks @patrick!