Commit dd20e68b authored by James M Snell's avatar James M Snell
Browse files

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
```

PR-URL: https://github.com/nodejs/node/pull/12725


Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
parent 23fc0824
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment