Skip to content

Commit

Permalink
Trapped AccessDeniedError got when cancelling or giving a wrong passw…
Browse files Browse the repository at this point in the history
…ord to avoid closing dnfdragora
  • Loading branch information
anaselli committed Jun 6, 2020
1 parent 9877704 commit f58e58e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
16 changes: 14 additions & 2 deletions dnfdragora/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Expand Down

0 comments on commit f58e58e

Please sign in to comment.