summaryrefslogtreecommitdiffstats
path: root/python/service.py
diff options
context:
space:
mode:
authorJohn (J5) Palmieri <johnp@redhat.com>2005-10-14 21:44:00 +0000
committerJohn (J5) Palmieri <johnp@redhat.com>2005-10-14 21:44:00 +0000
commit0ae9f138ad4dfacbbd28abd39ce3dee66333539a (patch)
treec2796ea79ca9e0eab9e5b4fa3be416a4b0394007 /python/service.py
parent7667a2ae4ae4912f8130895e828d1dfb87050870 (diff)
* python/dbus_bindings.pyx (MessageIter::append_strict): check for
STRUCT_BEGIN not TYPE_STRUCT in indicate we are marshalling a struct * python/service.py (Object::_message_cb): handle exceptions correctly by sending them over the wire to the calling app. This makes sure the client returns immediately instead of waiting the 15 seconds to timeout. * test/python/test-client.py (TestDBusBindings::testBenchmarkIntrospect): Add a test to benchmark how long it takes to introspect a service and call a method which returns a large element (pretty fast) * test/python/test-service.py (TestObject::GetComplexArray): new test method which pushes a lot of data
Diffstat (limited to 'python/service.py')
-rw-r--r--python/service.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/python/service.py b/python/service.py
index a4391837..0cc2ed9f 100644
--- a/python/service.py
+++ b/python/service.py
@@ -168,13 +168,19 @@ class Object:
print ("Unregister")
def _message_cb(self, connection, message):
- target_method_name = message.get_member()
- target_methods = self._dbus_method_vtable[target_method_name]
- args = message.get_args_list()
+ try:
+ target_method_name = message.get_member()
+ target_methods = self._dbus_method_vtable[target_method_name]
+ args = message.get_args_list()
- reply = _dispatch_dbus_method_call(target_methods, self, args, message)
-
- self._connection.send(reply)
+ reply = _dispatch_dbus_method_call(target_methods, self, args, message)
+
+ self._connection.send(reply)
+ except Exception, e:
+ error_reply = dbus_bindings.Error(message,
+ "org.freedesktop.DBus.Python.%s" % e.__class__.__name__,
+ str(e))
+ self._connection.send(error_reply)
@method('org.freedesktop.DBus.Introspectable')
def Introspect(self):