1

Can c# aws lambda function exception handling be done in a global method or only in each function separately?

2 Answers 2

3

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.

Sign up to request clarification or add additional context in comments.

Comments

1

To answer your question: No, neither the Lambda runtime or .Net Core support global exception handlers (ASP.Net Core does but that wasn't your question). This would be an excellent addition to the Lambda runtime for .Net Core, or perhaps as a Lambda Layer.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.