js: Remove unused catch bindings

Optional catch bindings have been supported for quite a while now,
so we can treat unused error bindings in catch statements like any
other unused variable.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3684>
This commit is contained in:
Florian Müllner
2025-04-01 16:16:07 +02:00
committed by Bruce Leidl
parent a7410d82ac
commit 60aa4319d9
35 changed files with 56 additions and 56 deletions

View File

@ -2621,7 +2621,7 @@ export class ScreenshotService {
screenshot.screenshot_area(x, y, width, height, stream),
]);
this._onScreenshotComplete(stream, file, invocation);
} catch (e) {
} catch {
invocation.return_value(new GLib.Variant('(bs)', [false, '']));
} finally {
this._removeShooterForSender(invocation.get_sender());
@ -2644,7 +2644,7 @@ export class ScreenshotService {
screenshot.screenshot_window(includeFrame, includeCursor, stream),
]);
this._onScreenshotComplete(stream, file, invocation);
} catch (e) {
} catch {
invocation.return_value(new GLib.Variant('(bs)', [false, '']));
} finally {
this._removeShooterForSender(invocation.get_sender());
@ -2667,7 +2667,7 @@ export class ScreenshotService {
screenshot.screenshot(includeCursor, stream),
]);
this._onScreenshotComplete(stream, file, invocation);
} catch (e) {
} catch {
invocation.return_value(new GLib.Variant('(bs)', [false, '']));
} finally {
this._removeShooterForSender(invocation.get_sender());
@ -2696,7 +2696,7 @@ export class ScreenshotService {
try {
Main.screenshotUI.open(UIMode.SCREENSHOT_ONLY);
} catch (e) {
} catch {
Main.screenshotUI.disconnectObject(invocation);
invocation.return_value(new GLib.Variant('(bs)', [false, '']));
}
@ -2717,7 +2717,7 @@ export class ScreenshotService {
areaRectangle.x, areaRectangle.y,
areaRectangle.width, areaRectangle.height);
invocation.return_value(GLib.Variant.new('(iiii)', retRectangle));
} catch (e) {
} catch {
invocation.return_error_literal(
Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED,
'Operation was cancelled');
@ -2763,7 +2763,7 @@ export class ScreenshotService {
]),
}]);
invocation.return_value(retval);
} catch (e) {
} catch {
invocation.return_error_literal(
Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED,
'Operation was cancelled');