mirror of
https://github.com/nodejs/node.git
synced 2024-11-25 16:34:05 +01:00
14 lines
306 B
JavaScript
14 lines
306 B
JavaScript
|
// Flags: --expose-internals
|
||
|
'use strict';
|
||
|
|
||
|
require('../common');
|
||
|
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);
|