Lambda should fail cleanly and throw an error if there is an unhandled error inside.
I use Lambda for a very complex data manipulation action. However, I found out that when the code inside Lambda encounters an unhandled error (null/undefined reference) it will return the error message as the result of the Lambda step.
IMO this is not a very intuitive thing to do and we should just cleanly 500 the API if Lambda has a runtime error.
Comments
-
Throwing the equivalent of a Precondition with the exception as payload would be more consistent and easy to debug
-
One can and should implement this in userland by wrapping your code in a try-catch and having the catch return a payload you can analyze for an error path. I will usually have a lambda return an object that looks more like an API call - status plus body - in order to manage this. Xano doesn't force a path, but norms can be as helpful as rules!
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