code: def run(self):
      
      while True:
        try:
          self._poll_for_update()
        except RuntimeError as error:
          # Note that because logging triggers a call to notify_update(), by
          # logging a message, we automatically retry publishing the update
          # after an error occurs.
          if error.message == 'dictionary changed size during iteration':
            # These errors occur occasionally and it is infeasible to get rid of
            # them entirely unless data.convert_to_base_types() is made
            # thread-safe. Ignore the error and retry quickly.
            _LOG.debug('Ignoring (probably harmless) error in station watcher: '
                       '`dictionary changed size during iteration`.')
            time.sleep(0.1)
          else:
            _LOG.exception('Error in station watcher: %s', error)
            time.sleep(1)
        except Exception as error:  # pylint: disable=broad-except
          _LOG.exception('Error in station watcher: %s', error)
          time.sleep(1)
docs: Call self._poll_for_update() in a loop and handle errors.