diff options
| author | Rafael H. Schloming <rhs@apache.org> | 2007-05-30 22:11:24 +0000 |
|---|---|---|
| committer | Rafael H. Schloming <rhs@apache.org> | 2007-05-30 22:11:24 +0000 |
| commit | 88859adc0c87a2261d39343daab2290dd6b3eb0e (patch) | |
| tree | 8a875fa57eec7c0e6f751df6a03a40fe6a685bb0 /python/qpid/delegate.py | |
| parent | 0fc923acb5e8746c59e0d3132fa330bdf53d374f (diff) | |
| download | qpid-python-88859adc0c87a2261d39343daab2290dd6b3eb0e.tar.gz | |
added listener support to queues, also added support for non version specific tests
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@542955 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid/delegate.py')
| -rw-r--r-- | python/qpid/delegate.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/python/qpid/delegate.py b/python/qpid/delegate.py index 90e5c1edc8..8f5033e485 100644 --- a/python/qpid/delegate.py +++ b/python/qpid/delegate.py @@ -21,9 +21,12 @@ Delegate implementation intended for use with the peer module. """ -import threading, inspect +import threading, inspect, traceback, sys from connection import Method, Request, Response +def _handler_name(method): + return "%s_%s" % (method.klass.name, method.name) + class Delegate: def __init__(self): @@ -36,11 +39,15 @@ class Delegate: try: handler = self.handlers[method] except KeyError: - name = "%s_%s" % (method.klass.name, method.name) + name = _handler_name(method) handler = getattr(self, name) self.handlers[method] = handler - return handler(channel, frame) + try: + return handler(channel, frame) + except: + print >> sys.stderr, "Error in handler: %s\n\n%s" % \ + (_handler_name(method), traceback.format_exc()) def close(self, reason): print "Connection closed: %s" % reason |
