1'use strict'; 2 3const common = require('../common'); 4const dc = require('diagnostics_channel'); 5const assert = require('assert'); 6 7const input = { 8 foo: 'bar' 9}; 10 11const channel = dc.channel('fail'); 12 13const error = new Error('nope'); 14 15process.on('uncaughtException', common.mustCall((err) => { 16 assert.strictEqual(err, error); 17})); 18 19channel.subscribe(common.mustCall((message, name) => { 20 throw error; 21})); 22 23// The failing subscriber should not stop subsequent subscribers from running 24channel.subscribe(common.mustCall()); 25 26// Publish should continue without throwing 27const fn = common.mustCall(); 28channel.publish(input); 29fn(); 30