[Zope-Checkins] CVS: Zope2 - ExternalMethod.py:1.44
andreas@serenade.digicool.com
andreas@serenade.digicool.com
Tue, 19 Jun 2001 09:26:50 -0400
Update of /cvs-repository/Zope2/lib/python/Products/ExternalMethod
In directory serenade:/tmp/cvs-serv20549/lib/python/Products/ExternalMethod
Modified Files:
ExternalMethod.py
Log Message:
added checks to __call__() method for better error handling/messages
--- Updated File ExternalMethod.py in package Zope2 --
--- ExternalMethod.py 2001/01/15 16:14:15 1.43
+++ ExternalMethod.py 2001/06/19 13:26:50 1.44
@@ -245,6 +245,18 @@
first argument.
"""
+ filePath = self.filepath()
+ if filePath==None:
+ raise RuntimeError,\
+ "external method could not be called " \
+ "because it is None"
+
+ if not os.path.exists(filePath):
+ raise RuntimeError,\
+ "external method could not be called " \
+ "because the file does not exist"
+
+
if DevelopmentMode:
# If the file has been modified since last loaded, force a reload.
ts=os.stat(self.filepath())[stat.ST_MTIME]