When an error event is send on the stream, the onError handler is called.
Future<void> onError(Object error);