Skip to content

Commit 8a706b9

Browse files
author
limodou
committed
Add more info about dispatch call exception output
git-svn-id: https://uliweb.googlecode.com/svn/trunk@990 14287918-b64d-0410-abb6-a92efa0c2026
1 parent 37087ba commit 8a706b9

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

‎CHANGELOG.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Uliweb Change Log
66
-----------------
77

88
#. Change cache settings, remove file_dir and lock_dir as 0.1.3 before
9+
#. Add more info about dispatch call exception output
910

1011
0.1.4 Version
1112
-----------------

‎uliweb/core/dispatch.py‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,11 @@ def _cmp(x, y):
103103
try:
104104
_f(sender, *args, **kw)
105105
except:
106-
logging.exception('Calling dispatch point [%s] error!' % topic)
106+
func = _f.__module__ + '.' + _f.__name__
107+
logging.exception('Calling dispatch point [%s] %s(%r, %r) error!' % (topic, func, args, kw))
107108
raise
108109
else:
109-
raise Exception, "Dispatch point [%s] can't been invoked" % topic
110+
raise Exception, "Dispatch point [%s] %r can't been invoked" % (topic, _f)
110111

111112
def call_once(sender, topic, *args, **kwargs):
112113
signal = kwargs.get('signal')
@@ -145,12 +146,13 @@ def _cmp(x, y):
145146
try:
146147
v = _f(sender, *args, **kwargs)
147148
except:
148-
logging.exception('Calling dispatch point [%s] error!' % topic)
149+
func = _f.__module__ + '.' + _f.__name__
150+
logging.exception('Calling dispatch point [%s] %s(%r,%r) error!' % (topic, func, args, kwargs))
149151
raise
150152
if v is not None:
151153
return v
152154
else:
153-
raise "Dispatch point [%s] can't been invoked" % topic
155+
raise "Dispatch point [%s] %r can't been invoked" % (topic, _f)
154156

155157
def get_once(sender, topic, *args, **kwargs):
156158
signal = kwargs.get('signal')

0 commit comments

Comments
 (0)