Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for non-critical installation errors #3147

Merged
merged 1 commit into from
Feb 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion pyanaconda/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from pyanaconda.core.i18n import _, C_
from pyanaconda.flags import flags
from pyanaconda.modules.common.errors.installation import BootloaderInstallationError, \
StorageInstallationError
StorageInstallationError, NonCriticalInstallationError
from pyanaconda.modules.common.errors.payload import SourceSetupError
from pyanaconda.modules.common.errors.storage import UnusableStorageError
from pyanaconda.payload.errors import PayloadInstallError, DependencyError, PayloadSetupError
Expand Down Expand Up @@ -110,6 +110,9 @@ def _get_default_mapping(self):
# Payload DBus errors
SourceSetupError.__name__: self._payload_setup_handler,

# General installation errors.
NonCriticalInstallationError.__name__: self._non_critical_error_handler,

# DNF errors
"MarkingErrors": self._install_specs_handler,
}
Expand Down Expand Up @@ -205,6 +208,16 @@ def _bootloader_error_handler(self, exn):
else:
return ERROR_RAISE

def _non_critical_error_handler(self, exn):
message = _("The following error occurred during the installation:"
"\n\n{details}\n\nWould you like to ignore this and "
"continue with installation?").format(details=str(exn))

if self.ui.showYesNoQuestion(message):
return ERROR_CONTINUE
else:
return ERROR_RAISE

def cb(self, exn):
"""This method is the callback that all error handling should pass
through. The return value is one of the ERROR_* constants defined
Expand Down
6 changes: 6 additions & 0 deletions pyanaconda/modules/common/errors/installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ class InstallationError(AnacondaError):
pass


@dbus_error("NonCriticalInstallationError", namespace=ANACONDA_NAMESPACE)
class NonCriticalInstallationError(AnacondaError):
"""Exception for the non-critical installation errors."""
pass


@dbus_error("LanguageInstallationError", namespace=ANACONDA_NAMESPACE)
class LanguageInstallationError(InstallationError):
"""Exception for the language installation errors."""
Expand Down