[Zope-Checkins] CVS: Zope3/lib/python/Zope/Configuration - xmlconfig.py:1.1.2.7
Jim Fulton
jim@zope.com
Tue, 12 Feb 2002 16:30:27 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/Configuration
In directory cvs.zope.org:/tmp/cvs-serv29663
Modified Files:
Tag: Zope-3x-branch
xmlconfig.py
Log Message:
Improved error formatting.
=== Zope3/lib/python/Zope/Configuration/xmlconfig.py 1.1.2.6 => 1.1.2.7 ===
if type(mess) is not type(''):
try:
- mess = "%s: %s" % (mess.__class__.__name__, mess)
+ mess = "\n%s: %s" % (mess.__class__.__name__, mess)
except AttributeError:
mess=str(mess)
self.lno=locator.getLineNumber()
@@ -37,7 +37,7 @@
self.mess=mess
def __str__(self):
- return "%s at line %s column %s of %s" % (
+ return "%s\nat line %s column %s of %s" % (
self.mess, self.lno, self.cno, self.sid)
class ConfigurationExecutionError(ZopeXMLConfigurationError):
@@ -71,7 +71,7 @@
if not stack:
if name != self.__top_name:
raise ZopeXMLConfigurationError(
- self.__locator, "Invalid top element: %s" % name)
+ self.__locator, "Invalid top element: %s %s" % name)
stack.append(None)
return
@@ -258,9 +258,3 @@
callable(*args, **kw)
except Exception, v:
raise ConfigurationExecutionError(loc, v)
-
-
-
-
-
-