How to handle API outage or errors from App Connect?

Hi,
I’ve got an API working fine, but I can’t work out how handle the response to a POST. For example, I after submitting a form which calls an API, I might want to redirect the user somewhere if the server responds with status. But with status 500 I would want to tell the user their updates haven’t been saved and keep the page where it so they can try again.

Can this be done with Wappler (without hacking any code)?

Regards,
Andy

Hi Andy,

Click on the form and in the right hand-side panel scroll to ‘dynamic events’ click on that - then click on ‘server connect’. You’ll see the types of responses you can create events based on. I’m not sure which one specifically relates to the catchall 500 error, maybe just ‘Error’ but you could select that - and then use that event to trigger an alert on the form to let the user know something went wrong.

Matt

1 Like

Oh god. I really should learn to just poke around and explore more, as there are so many times I’ve asked a question here, or read someone else’s, and the option is already in Wappler.

And it worked. Excellent.

Thanks Matt, really appreciate the help.

Andy

1 Like

This should help: