Error handling
![Tom Wolf](https://us.v-cdn.net/6037124/uploads/userpics/1IRV8SVYSO83/nN4I59IDV3XVE.jpg)
Hi there,
I'm having trouble wrapping my head around error handling. I'm calling an external API and sometimes it might through some error. I want to be notified about it immediatle via email.
I made the following logic:
The problem is, the If/else conditional won't execute since the function stack stops after the API request returns an error, so Xano won't send an email about it with Sendgrid (which is the Else part of the conditional).
What am I missing? How shoud I structure this logic?
Answers
-
Hi, Tom. Can you describe the errors you're trying to build handling for? Typically, an external API request won't halt execution of the function; the error response will just be stored in the target variable.
-
Hi, Chris. Ok, my bad, but your message kind of clarified it for me. I was checkint for null whereas I was supposed to check for a response status different than 200 :)
Thanks!
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