Skip to content

docs: update promise rejection section to reflect Node.js 15+ behavior#1377

Open
Vansh1811 wants to merge 1 commit intogoldbergyoni:masterfrom
Vansh1811:fix/promise-rejection-node15-update
Open

docs: update promise rejection section to reflect Node.js 15+ behavior#1377
Vansh1811 wants to merge 1 commit intogoldbergyoni:masterfrom
Vansh1811:fix/promise-rejection-node15-update

Conversation

@Vansh1811
Copy link
Copy Markdown

What this PR does

Updates sections/errorhandling/catchunhandledpromiserejection.md to reflect the current Node.js behavior regarding unhandled promise rejections.

Problem

The documentation currently states that unhandled promise rejections "disappear" and that Node.js warning messages are "obviously not a proper error handling method". This is outdated.

Fixes #1360

Changes

  • Updated the One Paragraph Explainer to clearly state that since Node.js 15+, unhandled promise rejections crash the process with exit code 1 — they no longer disappear silently
  • Added a version behavior table clarifying:
    • Node.js < 15: prints DEP0018 deprecation warning, process continues
    • Node.js 15+: crashes the process with exit code 1 (same as uncaught exceptions)
  • Updated the blog quote section to add a note clarifying that the browser-era behavior described in the quote no longer applies to modern Node.js

References

Updated the documentation to reflect changes in Node.js 15 regarding unhandled promise rejections, including new behavior and recommended practices for error handling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Outdated: unhandled promise rejections no longer disappear silently since Node.js 15

1 participant