onError method
StreamSubscription<Map<HostEventType, dynamic> >
onError({
- required ErrorHandler handler,
inherited
Implementation
StreamSubscription<Map<HostEventType, dynamic>> onError({required handler}) {
var subsription = h.eventStream.listen((event) {});
subsription.onData((data) {
if (data.containsKey(HostEventType.error)) {
handler(error: ArgumentError(data.values.first));
}
});
h.errorListenerHandlers
.update(handler, (value) => subsription, ifAbsent: () => subsription);
return subsription;
}