Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

process: Don't warn/throw on unhandled rejections when hook is set #33017

Closed
wants to merge 1 commit into from

Commits on Apr 23, 2020

  1. process: Don't warn/throw on unhandled rejections when hook is set

    --unhandled-rejections has three explicit modes (strict, warn, none)
    plus one implicit "default" mode, which logs an additional deprecation
    warning (DEP0018).
    
    Prior to this commit, the default mode was subtly different from warn
    mode. If the unhandledRejections hook is set, default mode suppresses
    all warnings. In warn mode, unhandledRejections would always fire a
    warning, regardless of whether the hook was set.
    
    In addition, prior to this commit, strict mode would always throw an
    exception, regardless of whether the hook was set.
    
    In this commit, all modes honor the unhandledRejections hook. If the
    user has set the hook, then the user has taken full responsibility over
    the behavior of unhandled rejections. In that case, no additional
    warnings or thrown exceptions will be fired, even in warn mode or
    strict mode.
    
    This commit is a stepping stone towards resolving DEP0018. After this
    commit, any code that includes an unhandledRejection hook will behave
    unchanged when we change the default mode.
    
    Refs: nodejs#26599
    dfabulich committed Apr 23, 2020
    Configuration menu
    Copy the full SHA
    d5409f4 View commit details
    Browse the repository at this point in the history