Server catch usage


I’m trying to understand the exact details of a Catch within server connect. This is all just sandbox stuff, so I’m artificially throwing an error by setting mail1 to an invalid host, and then sending an email. I also have a valid smtp host (sendgrid_tos) for sending an email within the catch.

Here is what I’m experiencing (php)…

This configuration sends the email in the catch, but returns as status of 200 (I would expect a 400 because of the response):
sends mail - status 200

This config does not send the email and sends a status 400:
no send status 400

This config does not send the email and returns status 200:
no send - status 200

I guess my question is: Can I send an email (or do any other processing) in a Catch, and also set an error response code?

Related: If I try to add a Send Mail into a catch, the systems prompts me to setup a mailer first, even though mailers are setup in the Steps…by design, or bug?

Screen Shot 2020-10-14 at 8.12.07 AM

bump…

Seeing your tests with the catch it looks like it is only executing the first step in the catch, it should however execute all the steps there as you would expect.

The confirmation for the mail setup is indeed wrong, Wappler checks if there is a mail setup step in front of the send step, it probably doesn’t detect this correctly when in the catch.

The catch is something that almost nobody seems to use and we are planning on a different implementation of it. I will check why it is not executing all the steps in the catch and post an update here as soon I have one.

I also found in the past some inconsistency when using the catch and was meaning to perform thorough testing but got driven away by other tasks. I was planning on using it though but I do understand why others would pass on this feature. Error handling is something that not many do.

What implementation have you guys got in mind? If you can explain high level.

This could well be a lack of understanding on what it is or how and when to use it. I’ve been error handling differently as I had no idea that I’d what that’s for. Now I know, I’d plan to use it so like JonL, keen to understand how this may change