File: Never-log-a-dbus-failure-to-retrieve-an-optional-property.patch

package info (click to toggle)
gnome-shell-extension-appindicator 59-4
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 680 kB
  • sloc: javascript: 4,158; xml: 159; python: 55; makefile: 10
file content (29 lines) | stat: -rw-r--r-- 1,006 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From: Alessandro Astone <alessandro.astone@canonical.com>
Date: Tue, 6 Aug 2024 14:43:54 +0200
Subject: Never log a dbus failure to retrieve an optional property

Chromium and Electron apps do not implement the IconAccessibleDesc
property and reply to the Get() method with a generic
  org.freedesktop.DBus.Error.Failed

Ignore all DBus errors for optional properties.

Fixes: #534
LP: #2064698
---
 appIndicator.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/appIndicator.js b/appIndicator.js
index 944afcc..87d69e4 100644
--- a/appIndicator.js
+++ b/appIndicator.js
@@ -194,7 +194,7 @@ class AppIndicatorProxy extends DBusProxy {
                     });
                 } catch (e) {
                     if (!AppIndicatorProxy.OPTIONAL_PROPERTIES.includes(p) ||
-                        !e.matches(Gio.DBusError, Gio.DBusError.UNKNOWN_PROPERTY))
+                        !(e instanceof Gio.DBusError))
                         logError(e);
                 }
             }));