diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-08-25 19:49:23 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-08-25 19:50:06 +0200 |
commit | 4cf5d6750704bb393b0d5dcb5ed4657810cff783 (patch) | |
tree | 3599443aab137851cd6f31fcaa5791d5f9d3e752 /src/dbus-common.c | |
parent | 50f74deea32476c3e19cda870857782576587d94 (diff) |
dbus: simplify some dbus error messages a bit
Diffstat (limited to 'src/dbus-common.c')
-rw-r--r-- | src/dbus-common.c | 11 |
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; +} |