Skip to content

events: show inspected error in uncaught 'error' message

If there is no handler for .emit('error', value) and value is not an Error object, we currently just call .toString() on it.

Almost always, using util.inspect() provides better information for diagnostic purposes, so prefer to use that instead.

Refs: https://github.com/nodejs/help/issues/1729

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Merge request reports

Loading