Error handling with xano's JS SDK
Options
juanelcano
Member ✭
in Webflow
Hi,
I have implemented the JS SDK in Webflow. I am successfully calling a post api in xano, as described in this video:
However, when testing the error cases, to manage the error handling I'm not able to catch the error. A simple case I'm doing is sending the api call with missing mandatory fields. Xano is giving me a 400 error but I cannot capture it to present in webflow the appropriate error message to the customer. If someone can help identify what I'm missing I would appreciate it. Details below:
Code that handles the click of the button in the form.
This is the error I get in the console when I exclude a mandatory field from xano api.
Regards
Tagged:
Comments
-
Hi again,
I have been able to fix it by adding .catch before the error:
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback