Menu
×
   ❮   
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

AWS Serverless Error Handling for Synchronous and Asynchronous Events


Error Handling for Synchronous and Asynchronous Events

There are two sorts of errors that can happen when you call a function:

  • Function errors
  • Call errors

Function error happens when Lambda correctly passes an event to your function, but the function throws an error before finishing.

A call error happens when the request is refused before it is received by your function.

An example of a call error could be an excessive payload or a lack of permissions.


Error Handling for Synchronous Events

There are no built-in retries in a synchronous call.

Error handling must be handled by you.

All forms of errors and retries should be handled.

An example of a synchronous event is a call between API Gateway and Lambda.


Error Handling for Asynchronous Events

Lambda has built-in retry features for asynchronous event sources like Amazon S3.

When Lambda receives an asynchronous event, it responds with a "success".

Then, it sends call requests to your function from a queue.

By default, Lambda retries the call request two more times if it returns function errors.

This retry value can be set between 0 and 2.

Lambda retries the call request for up to 6 hours if it returns call errors.

The call is also known as a function call.


Error Handling for Synchronous and Asynchronous Events Video

W3schools.com collaborates with Amazon Web Services to deliver digital training content to our students.


AWS Serverless Exercises

Test Yourself With Exercises

Exercise:

What are two types of errors when you call a function?

1.  error
2.  error

Start the Exercise


×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
[email protected]

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
[email protected]

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2024 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.