Can c# aws lambda function exception handling be done in a global method or only in each function separately?
2 Answers
If you want to handle problems in all of your functions it might be a good ideia to use a Dead Letter Queue that triggers a exception handling function.
Dead letter queue (DLQ) is an AWS Lambda feature that stores the messages that triggered the lambda and threw non user handled exceptions.
Then you can setup an AWS Simple Notification Topic to listen to this queue and trigger a second lambda function that handles your global errors.
It is easier done than said, haha. I recommend trying it.
You can use this Robust Serverless Application Design post as a guide.