joyent/node — pull request #4325 by jeffbski (2012-11-27 23:37:46+00:00)
Title: piped stream w/dst err listener should not throw

Add failing test for the following premise:

A piped stream should not throw an error if there is an `error`
listener on the pipe destination, so that error handling is
propagated through all of the pipes to the end where it can
be handled in one place.

So rather than having to do handle errors in each intermediate
stream as it is currently

```javascript
rstream
.on('error', handleErr)
.pipe(foo)
.on('error', handleErr)
.pipe(bar)
.on('error', handleErr);
```

we can simply handle these in one place at the end of the pipe
chain

```javascript
rstream
.pipe(foo)
.pipe(bar)
.on('error', handleErr);
```

If a source error handler or destination error handler exists
then we should not throw an error, but rather forward the
error to the destination error handler.