mirror of
https://github.com/nodejs/node.git
synced 2025-04-28 13:40:37 +00:00

PR-URL: https://github.com/nodejs/node/pull/34895 Reviewed-By: Bryan English <bryan@bryanenglish.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
30 lines
630 B
JavaScript
30 lines
630 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const dc = require('diagnostics_channel');
|
|
const assert = require('assert');
|
|
|
|
const input = {
|
|
foo: 'bar'
|
|
};
|
|
|
|
const channel = dc.channel('fail');
|
|
|
|
const error = new Error('nope');
|
|
|
|
process.on('uncaughtException', common.mustCall((err) => {
|
|
assert.strictEqual(err, error);
|
|
}));
|
|
|
|
channel.subscribe(common.mustCall((message, name) => {
|
|
throw error;
|
|
}));
|
|
|
|
// The failing subscriber should not stop subsequent subscribers from running
|
|
channel.subscribe(common.mustCall());
|
|
|
|
// Publish should continue without throwing
|
|
const fn = common.mustCall();
|
|
channel.publish(input);
|
|
fn();
|