SVN: r25707 - branches/quixote1

Neil Schemenauer <nascheme-fVcApmY9cLvQ3/1i3zOLAti2O/[email protected]> Tue, 7 Dec 2004 16:45:41 -0500
Newsgroups gmane.comp.web.quixote.cvs
Message-ID <[email protected]>
Author: nascheme
Date: 2004-12-07 16:45:31 -0500 (Tue, 07 Dec 2004)
New Revision: 25707

Modified:
   branches/quixote1/publish.py
Log:
Improve TraversalError message.


Modified: branches/quixote1/publish.py
===================================================================
--- branches/quixote1/publish.py	2004-12-06 23:59:36 UTC (rev 25706)
+++ branches/quixote1/publish.py	2004-12-07 21:45:31 UTC (rev 25707)
@@ -805,10 +805,12 @@
                           "be replaced by _q_lookup()" % type(container))
             object = container._q_getname(request, component)
         if object is None:
-            raise errors.TraversalError(
-                private_msg="object %r has no attribute %r" % (
-                                                    container,
-                                                    component))
+            if hasattr(container, component):
+                msg = ("object %r has attribute %r but it is not in "
+                       "_q_exports" % (container, component))
+            else:
+                msg = "object %r has no attribute %r" % (container, component)
+            raise errors.TraversalError(private_msg=msg)
 
     # From here on, you can assume that the internal_name is not None
     elif hasattr(container, internal_name):