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: add optional detail to process emitWarning #12725

Closed
wants to merge 1 commit into from

Commits on May 1, 2017

  1. process: add optional detail to process emitWarning

    Adds a new method signature variant for process.emitWarning()
    that accepts an options object. The options object may include
    a new `detail` option that allows additional detail text to be
    associated with the warning. By default, this additional text
    will be printed to stderr along with the warning, and included
    on the Warning Error object using the `.detail` property.
    
    e.g.
    
    ```js
    process.emitWarning('A message', {
      code: 'WARNING123',
      detail: 'This is additional detail'
    });
    // Emits:
    // (node {pid}) [WARNING123] Warning: A message
    // This is additional detail
    ```
    jasnell committed May 1, 2017
    Configuration menu
    Copy the full SHA
    0010d9a View commit details
    Browse the repository at this point in the history