title: Error handling with node.js streams
body: <p>What's the correct way to handle errors with streams? I already know there's an 'error' event you can listen on, but I want to know some more details about arbitrarily complicated situations. </p>
  
  <p>For starters, what do you do when you want to do a simple pipe chain:</p>
  
  <p><code>input.pipe(transformA).pipe(transformB).pipe(transformC)...</code></p>
  
  <p>And how do you properly create one of those transforms so that errors are handled correctly? </p>
  
  <p>More related questions:</p>
  
  <ul>
  <li>when an error happens, what happens to the 'end' event? Does it never get fired? Does it sometimes get fired? Does it depend on the transform/stream? What are the standards here?</li>
  <li>are there any mechanisms for propogating errors through the pipes? </li>
  <li>do domains solve this problem effectively? Examples would be nice.</li>
  <li>do errors that come out of 'error' events have stack traces? Sometimes? Never? is there a way to get one from them?</li>
  </ul>