mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
PR-URL: https://github.com/nodejs/node/pull/47498 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
16 lines
337 B
JavaScript
16 lines
337 B
JavaScript
// Flags: --expose-internals
|
|
'use strict';
|
|
|
|
require('../../common');
|
|
Error.stackTraceLimit = 1;
|
|
|
|
const { aggregateTwoErrors } = require('internal/errors');
|
|
|
|
const originalError = new Error('original');
|
|
const err = new Error('second error');
|
|
|
|
originalError.code = 'ERR0';
|
|
err.code = 'ERR1';
|
|
|
|
throw aggregateTwoErrors(err, originalError);
|