comparison 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
comparison
equal deleted inserted replaced
1061:3700165d68dc 1062:95758ef3faa8
57 57
58 class GenericException(dbus.DBusException): 58 class GenericException(dbus.DBusException):
59 def __init__(self, twisted_error): 59 def __init__(self, twisted_error):
60 super(GenericException, self).__init__() 60 super(GenericException, self).__init__()
61 try: 61 try:
62 error_name = str(twisted_error.value().__class__.__name__)
63 # twisted_error.value is a class 62 # twisted_error.value is a class
63 class_ = twisted_error.value().__class__
64 except TypeError: 64 except TypeError:
65 # twisted_error.value is an instance 65 # twisted_error.value is an instance
66 error_name = str(twisted_error.value.__class__.__name__) 66 class_ = twisted_error.value.__class__
67 self._dbus_error_name = const_ERROR_PREFIX + "." + error_name 67 self.args = (twisted_error.getErrorMessage(),)
68 self._dbus_error_name = '.'.join([const_ERROR_PREFIX, class_.__module__, class_.__name__])
68 69
69 70
70 class DbusObject(dbus.service.Object): 71 class DbusObject(dbus.service.Object):
71 72
72 def __init__(self, bus, path): 73 def __init__(self, bus, path):