node/test/message/error_aggregateTwoErrors.js
Geoffrey Booth d6e626d54c
test: remove cjs loader from stack traces
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>
2022-08-14 21:59:02 +00:00

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);