API Action Throw Error Option

Hi.
As of Wappler 4.1.2, if we add an API Action inside a Try Catch step in Server Actions, enabling Pass Errors does not actually throw the error to be cuaght by Catch. Instead, the execution stops and the error is passed to client side.
Confirmed by Patrick here: Try/catch API error

So, this FR is for Wappler to add another checkbox option to Throw Error alongside the Output & Pass Error options, so that the erorr response from API invoikes Catch with $_ERROR set to the response from API Action.

If anyone has a better solution for this in Wappler right now, please share. Else, please vote. :slight_smile:

I noticed the same issue only yesterday, and I think your idea is a good work around in my mind.

I’m bumping this topic and take the opportunity to suggest “Pass Error” checkbox should be off by default

“Pass Error” makes API errors difficult to diagnose. I was getting a “502 Bad Gateway” error and thought my web server was broken - turns out it was the API Action that was receiving that from the remote API :roll_eyes:

The suggested “Throw Error” seems more appropriate to be checked on by default

4 Likes

Another bump, agreeing with the others.

Have been dealing with this myself today.
I didn’t realize why Try/Catch doesn’t work before I read this topic carefully.
So it would be good to have predictable behavior here.