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 - #3 by patrick

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.

Bump.

1 Like

Another bump.

1 Like

Disappointed to see this being added to new features, but not being addressed where required.
@Teodor / @patrick

How do you mean not addressed where required? We actually exactly implemented it according your request! So you can define custom rate limiters and use them where you want…

He refers to the API Action step missing the Throw option

1 Like

Bump.
This should have been part of today's release.

That's now available in Wappler 6.7.3

For future reference, the topic in question is for the API Action step to throw an error if the request fails (e.g.: status code not 200), it has nothing to do with a Throw Error step

This is now added to the Api Action step via an inline extension update:

1 Like