nicer error message
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 23 Sep 2009 12:22:43 +0200
changeset 3415 ae884253edeb
parent 3414 fe6c99b96701
child 3416 d74c627981e1
nicer error message
server/hook.py
--- a/server/hook.py	Wed Sep 23 12:22:16 2009 +0200
+++ b/server/hook.py	Wed Sep 23 12:22:43 2009 +0200
@@ -67,10 +67,12 @@
         except AttributeError:
             raise
         except:
-            raise Exception('bad .events attribute %s on %s' % (obj.events, obj))
+            raise Exception('bad .events attribute %s on %s.%s' % (
+                obj.events, obj.__module__, obj.__name__))
         for event in obj.events:
             if event not in ALL_HOOKS:
-                raise Exception('bad event %s on %s' % (event, obj))
+                raise Exception('bad event %s on %s.%s' % (
+                    event, obj.__module__, obj.__name__))
         super(HooksRegistry, self).register(obj, **kwargs)
 
     def call_hooks(self, event, req=None, **kwargs):