Lambda should fail cleanly and throw an error if there is an unhandled error inside.

Options

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.

Tagged:

Comments

  • JClaveau
    JClaveau Member
    Options

    Throwing the equivalent of a Precondition with the exception as payload would be more consistent and easy to debug

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    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!