- Newest
- Most votes
- Most comments
When running the code sample provided in a local environment compared to running it in a Lambda environment, there is indeed a discrepancy between the way Node operates. NodeJs 10.x will return a warning regarding the unhandled promise rejection without failing the entire execution whereas Lambda will fail when the unhandled promise rejection warning is returned. This is the expected behavior for Lambda functions running NodeJS 10.x. Currently the best course of action it to be aware of this discrepancy and handle it accordingly in your function code. The potential implications of this issue have been raised and are being reviewed.
answered 7 years ago
This is a follow-up to the previous message.
When we upgrade versions of Lambda runtimes, we strive to maintain compatibility through the upgrade. However, sometimes these updates result in breaking changes that are aligned with the general guidelines of the language. Unhandled promise rejections have been deprecated by Node and the language has plans to terminate the Node.js process with a non-zero exit code in the future. The NodeJS 10 runtime is aligned with this direction and the prevailing opinion of the Node community is that unhandled rejections typically represent a serious bug. We realize that this change may affect specific customer functions. As a workaround you can try to remove listeners for unhandled promise rejections by calling process.removeAllListeners('unhandledRejection');
We apologize for the inconvenience that this change will cause for you. As a result of your feedback, we are evaluating ways by which we can communicate these changes better in the future.
answered 7 years ago
Relevant content
asked 3 years ago
asked 7 years ago
- AWS OFFICIALUpdated 2 years ago
