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.
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
The suggested “Throw Error” seems more appropriate to be checked on by default
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.
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…
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