style: Use space after catch

We currently use a consistent style of not adding spaces in catch
clauses, however that's inconsistent with the style we use for any
other statement. There's not really a good reason to stick with it,
so switch to the style gjs/eslint default to.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/49
This commit is contained in:
Florian Müllner
2019-01-26 19:51:38 +01:00
parent aaeff6d12b
commit 67f9e4c419
3 changed files with 15 additions and 15 deletions

View File

@@ -326,7 +326,7 @@ class DesktopTarget {
(o, res) => {
try {
o.set_attributes_finish(res);
} catch(e) {
} catch (e) {
log('Failed to update access time: ' + e.message);
}
});
@@ -353,7 +353,7 @@ class DesktopTarget {
// Hack: force nautilus to reload file info
this._touchFile(file);
});
} catch(e) {
} catch (e) {
log('Failed to mark file as trusted: ' + e.message);
}
});
@@ -391,7 +391,7 @@ class DesktopTarget {
// copy_async() isn't introspectable :-(
src.copy(dst, Gio.FileCopyFlags.OVERWRITE, null, null);
this._markTrusted(dst);
} catch(e) {
} catch (e) {
log('Failed to copy to desktop: ' + e.message);
}
@@ -563,7 +563,7 @@ class ApplicationsButton extends PanelMenu.Button {
let id;
try {
id = entry.get_desktop_file_id(); // catch non-UTF8 filenames
} catch(e) {
} catch (e) {
continue;
}
let app = appSys.lookup_app(id);

View File

@@ -84,7 +84,7 @@ class MountMenuItem extends PopupMenu.PopupBaseMenuItem {
_unmountFinish(mount, result) {
try {
mount.unmount_with_operation_finish(result);
} catch(e) {
} catch (e) {
this._reportFailure(e);
}
}
@@ -92,7 +92,7 @@ class MountMenuItem extends PopupMenu.PopupBaseMenuItem {
_ejectFinish(mount, result) {
try {
mount.eject_with_operation_finish(result);
} catch(e) {
} catch (e) {
this._reportFailure(e);
}
}

View File

@@ -45,7 +45,7 @@ class PlaceInfo {
return (_ignored, result) => {
try {
Gio.AppInfo.launch_default_for_uri_finish(result);
} catch(e) {
} catch (e) {
if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_MOUNTED)) {
let source = {
get_icon: () => { return this.icon; }
@@ -55,7 +55,7 @@ class PlaceInfo {
try {
op.close();
file.mount_enclosing_volume_finish(result);
} catch(e) {
} catch (e) {
if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.FAILED_HANDLED))
// e.g. user canceled the password dialog
return;
@@ -94,7 +94,7 @@ class PlaceInfo {
let info = file.query_info_finish(result);
this.icon = info.get_symbolic_icon();
this.emit('changed');
} catch(e) {
} catch (e) {
if (e instanceof Gio.IOErrorEnum)
return;
throw e;
@@ -122,7 +122,7 @@ class PlaceInfo {
try {
let info = this.file.query_info('standard::display-name', 0, null);
return info.get_display_name();
} catch(e) {
} catch (e) {
if (e instanceof Gio.IOErrorEnum)
return this.file.get_basename();
throw e;
@@ -203,7 +203,7 @@ class PlaceDeviceInfo extends PlaceInfo {
_ejectFinish(mount, result) {
try {
mount.eject_with_operation_finish(result);
} catch(e) {
} catch (e) {
this._reportFailure(e);
}
}
@@ -211,7 +211,7 @@ class PlaceDeviceInfo extends PlaceInfo {
_unmountFinish(mount, result) {
try {
mount.unmount_with_operation_finish(result);
} catch(e) {
} catch (e) {
this._reportFailure(e);
}
}
@@ -350,7 +350,7 @@ var PlacesManager = class {
let file = Gio.File.new_for_path(specialPath), info;
try {
info = new PlaceInfo('special', file);
} catch(e) {
} catch (e) {
if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_FOUND))
continue;
throw e;
@@ -517,7 +517,7 @@ var PlacesManager = class {
try {
devItem = new PlaceDeviceInfo(kind, mount);
} catch(e) {
} catch (e) {
if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_FOUND))
return;
throw e;
@@ -531,7 +531,7 @@ var PlacesManager = class {
try {
volItem = new PlaceVolumeInfo(kind, volume);
} catch(e) {
} catch (e) {
if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_FOUND))
return;
throw e;