inject an error listener into a stream