onException method

  1. @override
StreamSubscription<Map<HostEventType, dynamic>> onException({
  1. required ExceptionHandler handler,
})
inherited

Implementation

@override
StreamSubscription<Map<HostEventType, dynamic>> onException({
  required ExceptionHandler handler,
}) {
  final subsription = h.eventStream.listen((data) {
    if (data.containsKey(HostEventType.error)) {
      handler(exception: data.values.first);
    }
  });
  h.exceptionListenerHandlers
      .update(handler, (value) => subsription, ifAbsent: () => subsription);
  return subsription;
}