frontends (dbus): error is not truncated anymore if it's not a SàT error.

This commit is contained in:
Goffi 2014-09-08 21:23:21 +02:00
commit 3a983b17db
2 changed files with 10 additions and 2 deletions

View file

@ -43,7 +43,11 @@ def dbus_to_bridge_exception(dbus_e):
@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).

View file

@ -43,7 +43,11 @@ def dbus_to_bridge_exception(dbus_e):
@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).