Error Handling, Retries & Dead-Letter Queues
Build robust Lambda functions by understanding how errors propagate, how retries work per invocation type, and how dead-letter queues capture failures.
Errors in Serverless Functions
When a function throws or times out, the platform treats it as a failed invocation. How that failure is handled depends on how the function was invoked.
- Synchronous: error returns to the caller
- Asynchronous: platform retries automatically
- Stream/poll: behavior depends on the source
Synchronous Error Handling
For synchronous calls (like an API request) the error is returned immediately to the caller. The caller, such as API Gateway, decides how to map it to an HTTP status.
All lessons in this course
- Lambda Runtime and Handler
- Environment Variables and Layers
- Logging and Monitoring with CloudWatch
- Error Handling, Retries & Dead-Letter Queues