Skip to content

Commit

Permalink
fix: listen to the channel error
Browse files Browse the repository at this point in the history
need to figure out the best way to handle the error and if we should be emitting the errors
  • Loading branch information
jacobheun committed Feb 7, 2019
1 parent 9cb3a0b commit f1904c7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ class Mplex extends EE {
chan.once('close', () => {
list[id] = null
})
chan.once('error', (_) => {
// TODO: Should we handle this? Internally the channel
// is handling errors. In node 10+ if we dont catch this
// error, it will be thrown. Perhaps channel shouldnt be
// emitting errors?
})

list[id] = chan
return chan
Expand Down

0 comments on commit f1904c7

Please sign in to comment.