summaryrefslogtreecommitdiff
path: root/src/dbus-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dbus-common.c')
-rw-r--r--src/dbus-common.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/dbus-common.c b/src/dbus-common.c
index 628efae4cf..69593cd183 100644
--- a/src/dbus-common.c
+++ b/src/dbus-common.c
@@ -88,3 +88,14 @@ int bus_connect(DBusBusType t, DBusConnection **_bus, bool *private, DBusError *
*_bus = bus;
return 0;
}
+
+const char *bus_error_message(const DBusError *error) {
+ assert(error);
+
+ /* Sometimes the D-Bus server is a little bit too verbose with
+ * its error messages, so let's override them here */
+ if (dbus_error_has_name(error, DBUS_ERROR_ACCESS_DENIED))
+ return "Access denied";
+
+ return error->message;
+}