add error handler of stream pipe