title: Node.js - How to handle stream error events
body: <p>I'm reading from a file stream returned from fs.createReadStream() and I'm piping it to a gzip stream created using zlib.createGzip() and then I'm piping the gzip stream to a HTTP response.</p>
  
  <p>I'm not sure how to deal with the 'error' event on these streams. I just want to make sure that all the the streams get closed, that the error is logged, and that no resources are leaked (note that the file stream has autoClose set to true).</p>
  
  <p>If an error happens on the fs read stream for example, how will that affect the gzip stream and then the response stream? Will the 'error' event be propagated automatically or will it just be unhandled and crash my app? Should I listen for the 'error' event on each of the streams or just on the last stream in the chain? What would happen if I listen to the 'error' on the fs stream - Will the gzip stream still detect that an error has occurred?</p>