changed errors a bit more.

This commit is contained in:
John Shaver 2018-05-04 09:34:27 -07:00
parent 9eb96be46c
commit 4b9db320c0
1 changed files with 3 additions and 1 deletions

View File

@ -160,7 +160,9 @@ module.exports.create = function (deps, config) {
"Number of errorListeners:", conn.listenerCount("error"),
"Error: ", err
);
if(!conn.listenerCount("error")) conn.emit("error", err);
if(conn.listenerCount("error") <= 1) {
process.nextTick(function() {conn.emit("error", err);});
}
});
conn.removeListener('error', onError);
peek(conn, chunk, opts);