AWS Lambda & API Gateway Error Handling

published on
It’s fragile and kind of terrible. Let’s look at it. We have a function named lambda. It has one argument named action (enum with allowed values data, exception or timeout). First thing we would like to do is to validate input via schema. Then we would like to return custom error message (and status code) if it’s invalid or do other things based on the action argument value. Here’s the code, just to demonstrate how it works. Read More...