I see now about the domain. Can you add a comment explaining that?

I agree that every stream needs its own error handler. What confused me was that I expected the code that clears the interval to be once'd on any error in the /pipeline/, not on individual stream errors. But I guess clearing an interval more than once isn't that bad. 

> On Nov 7, 2013, at 5:14 PM, Jonah Kagan <notifications@github.com> wrote:
> 
> In lib/understream.coffee:
> 
> > +
> > +to_report_string = (stream) -> _([
> > +  state_to_string stream._writableState
> > +  stream.constructor.name
> > +  stream._extra_report_string?()
> > +  state_to_string stream._readableState
> > +]).compact().join(' ')
> > +
> > +add_reporter = (streams) ->
> > +  report = -> console.log _(streams).map(to_report_string).join(' | ')
> > +  interval = setInterval report, 5000
> > +  # On error, clear the interval, remove the listener, and then reemit the
> > +  # error so the domain can catch it.
> > +  _(streams).each (stream) -> stream.once 'error', (args...) ->
> > +    clearInterval interval
> > +    stream.emit 'error', args...
> I reemit the error because otherwise the domain in .run() doesn't catch it. I guess domains only catch unhandled errors?
> 
> When there is an error in the pipeline, does each stream emit it? I thought just one stream would emit it, so we needed a handler on each.
> 
> —
> Reply to this email directly or view it on GitHub.