Skip to content

Commit

Permalink
Notify on every error with device attachment
Browse files Browse the repository at this point in the history
Currently only QubesExceptions merited their own notifications,
changed it for all Exceptions to cause a notification.

references QubesOS/qubes-issues#4849
  • Loading branch information
marmarta committed May 3, 2019
1 parent ceaae47 commit aee2724
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions qui/tray/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,13 @@ def attach_item(self, menu_item):
"Attaching {} to {}".format(self.device.description,
menu_item.vm),
Gio.NotificationPriority.NORMAL)
except qubesadmin.exc.QubesException as ex:
except Exception as ex: # pylint: disable=broad-except
self.gtk_app.emit_notification(
"Error",
"Attaching device {0} to {1} failed. Error: {2}".format(
self.device.description, menu_item.vm, ex),
Gio.NotificationPriority.HIGH,
error=True)
except Exception: # pylint: disable=broad-except
traceback.print_exc(file=sys.stderr)

def detach_item(self):
Expand Down

0 comments on commit aee2724

Please sign in to comment.