def _check_network_and_update()

in sdw_updater/UpdaterApp.py [0:0]


    def _check_network_and_update(self):
        """
        Wrapper for `apply_all_updates` that ensures network connectivity
        before updating, else stops the update and shows a connectivity error
        message to the user.

        Because this check happens before updates begin, an error at this stage
        simply stops the update attempt and does not affect the last
        UpdateStatus or affect the update timestamp.
        """

        if self._skip_netcheck:
            logger.info("Network check skipped; launching updater")
            self.apply_all_updates()
        elif _is_netcheck_successful():
            logger.info("Network check successful; checking for updates.")
            self.apply_all_updates()
        else:
            logger.error("Network connectivity check failed; cannot check for updates.")
            self._show_network_error()