[gnome-shell-extensions/wip/fmuellner/cleanups: 7/13] style: Use space after catch
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell-extensions/wip/fmuellner/cleanups: 7/13] style: Use space after catch
- Date: Mon, 28 Jan 2019 04:15:23 +0000 (UTC)
commit cb36250acf2b48c0c9be9312ad1a5a6919363ece
Author: Florian Müllner <fmuellner gnome org>
Date: Sat Jan 26 19:51:38 2019 +0100
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
extensions/apps-menu/extension.js | 8 ++++----
extensions/drive-menu/extension.js | 4 ++--
extensions/places-menu/placeDisplay.js | 18 +++++++++---------
3 files changed, 15 insertions(+), 15 deletions(-)
---
diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js
index 7a3690c..7efccf3 100644
--- a/extensions/apps-menu/extension.js
+++ b/extensions/apps-menu/extension.js
@@ -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);
diff --git a/extensions/drive-menu/extension.js b/extensions/drive-menu/extension.js
index 56141a7..918d298 100644
--- a/extensions/drive-menu/extension.js
+++ b/extensions/drive-menu/extension.js
@@ -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);
}
}
diff --git a/extensions/places-menu/placeDisplay.js b/extensions/places-menu/placeDisplay.js
index b57ead4..9f36d30 100644
--- a/extensions/places-menu/placeDisplay.js
+++ b/extensions/places-menu/placeDisplay.js
@@ -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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]