diff src/bridge/DBus.py @ 1062:95758ef3faa8

bridge: async failures are more detailed (full class name + error message)
author souliane <souliane@mailoo.org>
date Sat, 07 Jun 2014 15:20:39 +0200
parents aa15453ec54d
children f094583732de
line wrap: on
line diff
--- a/src/bridge/DBus.py	Mon Jun 02 19:25:06 2014 +0200
+++ b/src/bridge/DBus.py	Sat Jun 07 15:20:39 2014 +0200
@@ -59,12 +59,13 @@
     def __init__(self, twisted_error):
         super(GenericException, self).__init__()
         try:
-            error_name = str(twisted_error.value().__class__.__name__)
             # twisted_error.value is a class
+            class_ = twisted_error.value().__class__
         except TypeError:
             # twisted_error.value is an instance
-            error_name = str(twisted_error.value.__class__.__name__)
-        self._dbus_error_name = const_ERROR_PREFIX + "." + error_name
+            class_ = twisted_error.value.__class__
+            self.args = (twisted_error.getErrorMessage(),)
+        self._dbus_error_name = '.'.join([const_ERROR_PREFIX, class_.__module__, class_.__name__])
 
 
 class DbusObject(dbus.service.Object):