Hello dear Wappler superstars,
I’m trying to take advantage of the Library feature to have reusable actions.
The problem I’m facing is with validation handling.
Unless I missed something…
Whenever there is a validation error, it stops the original server action that is calling the library.
I can’t intercept validation errors to implement my own logic with try catch blocks for instance.
Use case is : Webhook receives contact informations to process.
It might contain or not a phone number.
If it does, we have to clean it through a library server action and format it to e164 standard.
Now in the lib…
Depending on the phone number format, the lib can require an additional country field to be provided.
If it’s missing, it would throw an error.
Back in the webhook action…
We would intercept that error, skip the phone number logic and continue to process the other contact info fields.
I haven’t followed all recent improvement but always felt like error handling was a weakspot in 3.X
It’s like some components are made to make your life easier but… you can’t really use them… and have to go back to custom coding your logic if you want tight error/validation handling on all fronts (api included).
Any improvements already available or planned in the future on that matter ?
Thank you very much for your help !
Last updated: