diff --git a/Changes b/Changes index 237265af..6ebc0da5 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,5 @@ +- Trapped AccessDeniedError got when cancelling or giving a wrong password to + avoid closing dnfdragora - Fixed Build transaction cancelled (https://bugzilla.redhat.com/show_bug.cgi?id=1833623) - Added Message box for users if build transaction fails - New icons (thanks to Carson Black) diff --git a/dnfdragora/ui.py b/dnfdragora/ui.py index 05189dc1..4e3d5509 100644 --- a/dnfdragora/ui.py +++ b/dnfdragora/ui.py @@ -1836,8 +1836,20 @@ def _manageDnfDaemonEvent(self): if not info['error']: self._OnRunTransaction(info) else: - logger.error("Search error: %s", str(info['error'])) - raise UIError(str(info['error'])) + res = info['error'] + if isinstance(res, Exception) : + if 'AccessDeniedError' in str(res): + # user should have pressed cancel on auth. Wrong password alert seems to be managed outside too + # avoid a dialog to recall the user what he did, let's see if we have negative feedbacks + # dialogs.warningMsgBox({'title' : _("AccessDeniedError"), "text": _("Cancel or wrong password given:%(NL)s%(error)s")%{'NL': "\n",'error' : str(res)}}) + + # we've already confirmed build transaction but failed authentication if for any reasons we reset or change the selection + # next transaction is confirmed without asking so we change the status and ask for confirmation again + self._status = DNFDragoraStatus.RUNNING + self._enableAction(True) + else: + logger.error("RunTransaction error: %s", str(info['error'])) + raise UIError(str(info['error'])) elif (event == 'OnTransactionEvent'): self._OnTransactionEvent(info['event'], info['data']) elif (event == 'OnRPMProgress'):