mirror of
https://github.com/nodejs/node.git
synced 2024-11-30 23:43:09 +01:00
e852289802
Error stacks and multiline error messages were not correct indented. This is fixed by this patch. PR-URL: https://github.com/nodejs/node/pull/20802 Refs: https://github.com/nodejs/node/issues/20253 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
13 lines
334 B
JavaScript
13 lines
334 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
const util = require('util');
|
|
|
|
const err = new Error('foo\nbar');
|
|
|
|
console.log(util.inspect({ err, nested: { err } }, { compact: true }));
|
|
console.log(util.inspect({ err, nested: { err } }, { compact: false }));
|
|
|
|
err.foo = 'bar';
|
|
console.log(util.inspect(err, { compact: true, breakLength: 5 }));
|