added error on pipe + callback

The callback now takes an error (which is emitted by the pipe)

function(err, data) {
   ...
}