Skip to content

Commit

Permalink
statusNotifierWatcher: Return possible errors in registration to clients
Browse files Browse the repository at this point in the history
  • Loading branch information
3v1n0 committed Sep 30, 2022
1 parent eec4888 commit b60005d
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions statusNotifierWatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ var StatusNotifierWatcher = class AppIndicatorsStatusNotifierWatcher {
}
}

_ensureItemRegistered(service, busName, objPath) {
async _ensureItemRegistered(service, busName, objPath) {
const id = Util.indicatorId(service, busName, objPath);
let item = this._items.get(id);

Expand All @@ -139,7 +139,7 @@ var StatusNotifierWatcher = class AppIndicatorsStatusNotifierWatcher {
return;
}

this._registerItem(service, busName, objPath);
await this._registerItem(service, busName, objPath);
}

async _seekStatusNotifierItems() {
Expand Down Expand Up @@ -203,9 +203,15 @@ var StatusNotifierWatcher = class AppIndicatorsStatusNotifierWatcher {
return;
}

this._ensureItemRegistered(service, busName, objPath);

invocation.return_value(null);
try {
await this._ensureItemRegistered(service, busName, objPath);
invocation.return_value(null);
} catch (e) {
if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
logError(e);
invocation.return_dbus_error('org.gnome.gjs.JSError.ValueError',
e.message);
}
}

_onIndicatorDestroyed(indicator) {
Expand Down

0 comments on commit b60005d

Please sign in to comment.