diff --git a/common/config.py b/common/config.py index a6a912371..a951607a3 100644 --- a/common/config.py +++ b/common/config.py @@ -48,7 +48,7 @@ import pluginmanager import schedule from storagesize import StorageSize, SizeUnit -from exceptions import PermissionDeniedByPolicy +from exceptions import PermissionDeniedByPolicy, Timeout class Config(configfile.ConfigFileWithProfiles): @@ -1499,6 +1499,15 @@ def _setup_event_based_automation(self): self.notifyError(str(err)) return False + except Timeout: + msg = _( + 'Timed out while waiting for the authentication dialog. ' + 'Please try again.' + ) + logger.error(msg, self) + self.notifyError(msg) + return False + def _setup_schedule_based_automation(self): """Update the current users crontab file based on profile settings. diff --git a/common/tools.py b/common/tools.py index 094e71e00..4b7a3b449 100644 --- a/common/tools.py +++ b/common/tools.py @@ -2258,6 +2258,9 @@ def save(self): == 'com.ubuntu.DeviceDriver.PermissionDeniedByPolicy'): raise PermissionDeniedByPolicy(str(err)) from err + if err._dbus_error_name == 'org.freedesktop.DBus.Error.NoReply': + raise Timeout() from err + raise err def clean(self):