You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
```shell
sending error event
caught error Error: Uncaught, unspecified 'error' event.
at EventEmitter.emit (/home/agirorn/tmp/test-propagate-eventemitter2/node_modules/eventemitter2/lib/eventemitter2.js:398:15)
at EventEmitter.source.emit (/home/agirorn/tmp/test-propagate-eventemitter2/node_modules/propagate/index.js:19:13)
at Object.<anonymous> (/home/agirorn/tmp/test-propagate-eventemitter2/test.js:15:10)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:383:7)
➜ test-propagate-eventemitter2
expected result
sending error event
got error event The error data
The text was updated successfully, but these errors were encountered:
You should have at least one error listener in the source emitter to avoid throwing this error.
Since 6.1.0 we have the ignoreErrors option for the EventEmitter2 constructor to disable this behavior.
Propagate could be enhanced to work with eventemmiter2 and not fail when the error event is emitted.
Relates to EventEmitter2/EventEmitter2#215
How to repoduce
``js
#!/usr/bin/env node
const EventEmitter2 = require('eventemitter2').EventEmitter2;
const propagate = require('propagate');
const source = new EventEmitter2();
const dest = new EventEmitter2();
propagate(source, dest);
dest.on('error', (error) => { console.log('got error event', error); });
console.log('sending error event');
try {
source.emit('error', 'The error data');
} catch(e) {
console.log('caught error', e);
}
expected result
The text was updated successfully, but these errors were encountered: