Commit 56410251 authored by segfault's avatar segfault
Browse files

unlock-veracrypt-volume: Improve error message

parent 137a7aa4
......@@ -325,11 +325,17 @@ class Volume(object):
self.unmount()
self.backing_volume.lock()
except GLib.Error as e:
# Translators: Don't translate {volume_name} or {error_message},
# they are placeholder and will be replaced.
body = _("Couldn't lock volume {volume_name}:\n{error_message}".format(volume_name=self.name,
error_message=e.message))
self.manager.show_warning(_("Error locking volume"), body)
# Show a more helpful message for the known error cases
if e.domain == "udisks-error-quark" and e.code == UDisks.Error.DEVICE_BUSY:
body = _("One or more applications are keeping the volume busy.")
# Show a general error message and print the detailed, technical
# message in unknown error cases
else:
# Translators: Don't translate {volume_name} or {error_message},
# they are placeholder and will be replaced.
body = _("Couldn't lock volume {volume_name}:\n{error_message}".format(volume_name=self.name,
error_message=e.message))
self.manager.show_warning(_("Locking the volume failed"), body)
return
def on_unlock_button_clicked(self, button):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment