mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
d6e626d54c
PR-URL: https://github.com/nodejs/node/pull/44197 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Michaël Zasso <targos@protonmail.com>
16 lines
334 B
JavaScript
16 lines
334 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);
|