diff src/bridge/bridge_constructor/dbus_frontend_template.py @ 1188:bf2927e6a0f5

frontends (dbus): error is not truncated anymore if it's not a SàT error.
author Goffi <goffi@goffi.org>
date Mon, 08 Sep 2014 21:23:21 +0200
parents f094583732de
children faa1129559b8
line wrap: on
line diff
--- a/src/bridge/bridge_constructor/dbus_frontend_template.py	Mon Sep 08 21:23:18 2014 +0200
+++ b/src/bridge/bridge_constructor/dbus_frontend_template.py	Mon Sep 08 21:23:21 2014 +0200
@@ -43,7 +43,11 @@
     @param dbus_e (DBusException)
     @return: BridgeException
     """
-    name = dbus_e.get_dbus_name()[len(const_ERROR_PREFIX) + 1:]
+    full_name = dbus_e.get_dbus_name()
+    if full_name.startswith(const_ERROR_PREFIX):
+        name = dbus_e.get_dbus_name()[len(const_ERROR_PREFIX) + 1:]
+    else:
+        name = full_name
     # XXX: dbus_e.args doesn't contain the original DBusException args, but we
     # receive its serialized form in dbus_e.args[0]. From that we can rebuild
     # the original arguments list thanks to ast.literal_eval (secure eval).