[Zodb-checkins] CVS: Packages/SFTPGateway/src/ZConfig - __init__.py:1.12

Fred L. Drake, Jr. fred at zope.com
Sun Dec 28 20:17:37 EST 2003


Update of /cvs-repository/Packages/SFTPGateway/src/ZConfig
In directory cvs.zope.org:/tmp/cvs-serv28201

Modified Files:
	__init__.py 
Log Message:
introduce a more-specific error for resource loading errors when
loading a schema component


=== Packages/SFTPGateway/src/ZConfig/__init__.py 1.11 => 1.12 ===
--- Packages/SFTPGateway/src/ZConfig/__init__.py:1.11	Thu Oct  2 14:17:24 2003
+++ Packages/SFTPGateway/src/ZConfig/__init__.py	Sun Dec 28 20:15:30 2003
@@ -60,6 +60,30 @@
         _ParseError.__init__(self, msg, url, lineno, colno)
 
 
+class SchemaResourceError(SchemaError):
+    """Raised when there's an error locating a resource required by the schema.
+    """
+
+    def __init__(self, msg, url=None, lineno=None, colno=None,
+                 path=None, package=None, filename=None):
+        self.filename = filename
+        self.package = package
+        if path is not None:
+            path = path[:]
+        self.path = path
+        SchemaError.__init__(self, msg, url, lineno, colno)
+
+    def __str__(self):
+        s = SchemaError.__str__(self)
+        if self.package is not None:
+            s += "\n  Package name: " + repr(self.package)
+        if self.filename is not None:
+            s += "\n  File name: " + repr(self.filename)
+        if self.package is not None:
+            s += "\n  Package path: " + repr(self.path)
+        return s
+
+
 class ConfigurationMissingSectionError(ConfigurationError):
     def __init__(self, type, name=None):
         self.type = type




More information about the Zodb-checkins mailing list