Adds onError functionality for notifying on stream error.
v0.2.0