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...