Catch, Server Connect?

Hey Dave,

Normally, if you have not defined any steps under catch and some of the steps in your server action results in an error - then the server action just ends, and an error message is generated.

If you want to create your own error handler, like for example - sending an email, when there was an error during executing the server action, you place the send mail step under catch.

Another example - you insert some data into the db and then upload an image related with this record, but the upload returns an error … you can remove the last inserted record in the catch steps.

5 Likes