places-menu: report errors for mounting of volumes

When launching an application for an uri we detect the case that
the volume is not mounted and try to mount it. If this fails we
don't report any error, so there is no feedback for the user.
This commit is contained in:
Christian Kellner
2017-04-28 11:02:10 +02:00
parent cfbb2a459b
commit c82f8a995b
+7 -1
View File
@@ -50,7 +50,13 @@ const PlaceInfo = new Lang.Class({
Gio.AppInfo.launch_default_for_uri_finish(result);
} catch(e if e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_MOUNTED)) {
this.file.mount_enclosing_volume(0, null, null, (file, result) => {
file.mount_enclosing_volume_finish(result);
try {
file.mount_enclosing_volume_finish(result);
} catch(e) {
Main.notifyError(_("Failed to mount volume for “%s”").format(this.name), e.message);
return;
}
if (tryMount) {
let callback = this._createLaunchCallback(launchContext, false);
Gio.AppInfo.launch_default_for_uri_async(file.get_uri(),