[Zope-Checkins] CVS: Zope/lib/python/Shared/DC/ZRDB - Aqueduct.py:1.56.90.1 Connection.py:1.35.68.2.2.1 DA.py:1.110.12.2.4.1 Search.py:1.20.90.1 dbi_db.py:1.10.90.1 sqlgroup.py:1.9.90.1 sqltest.py:1.18.90.1 sqlvar.py:1.14.32.1

Tres Seaver cvs-admin at zope.org
Mon Nov 17 17:10:33 EST 2003


Update of /cvs-repository/Zope/lib/python/Shared/DC/ZRDB
In directory cvs.zope.org:/tmp/cvs-serv12097/lib/python/Shared/DC/ZRDB

Modified Files:
      Tag: tseaver-strexp_delenda-branch
	Aqueduct.py Connection.py DA.py Search.py dbi_db.py 
	sqlgroup.py sqltest.py sqlvar.py 
Log Message:



  - Rip string exceptins out by the root.

  - webdav/*:  clean up block statements for readability.

  - XXX:  Redirects are now showing up in the error log object;  need
          to filter!


=== Zope/lib/python/Shared/DC/ZRDB/Aqueduct.py 1.56 => 1.56.90.1 ===
--- Zope/lib/python/Shared/DC/ZRDB/Aqueduct.py:1.56	Wed Aug 14 17:50:59 2002
+++ Zope/lib/python/Shared/DC/ZRDB/Aqueduct.py	Mon Nov 17 17:10:00 2003
@@ -24,6 +24,7 @@
 from OFS import SimpleItem
 from AccessControl.Role import RoleManager
 from DocumentTemplate import HTML
+from zExceptions import Redirect
 
 from string import strip, replace
 
@@ -121,7 +122,7 @@
 
     def index_html(self, URL1):
         " "
-        raise 'Redirect', ("%s/manage_testForm" % URL1)
+        raise Redirect, ("%s/manage_testForm" % URL1)
 
 class Composite:
 


=== Zope/lib/python/Shared/DC/ZRDB/Connection.py 1.35.68.2 => 1.35.68.2.2.1 ===
--- Zope/lib/python/Shared/DC/ZRDB/Connection.py:1.35.68.2	Wed Oct 22 16:32:00 2003
+++ Zope/lib/python/Shared/DC/ZRDB/Connection.py	Mon Nov 17 17:10:01 2003
@@ -26,6 +26,7 @@
 from sys import exc_info
 from zLOG import LOG, ERROR
 import DocumentTemplate, RDB
+from zExceptions import BadRequest
 
 class Connection(
     Globals.Persistent,
@@ -168,7 +169,7 @@
             if s:
                 self.connect(s)
                 return self._v_database_connection
-            raise 'Database Not Connected',(
+            raise BadRequest,(
                 '''The database connection is not connected''')
 
     def connect(self,s):
@@ -179,7 +180,7 @@
                 self._v_database_connection=DB(s)
             except:
                 t, v, tb = sys.exc_info()
-                raise 'BadRequest', (
+                raise BadRequest, (
                     '<strong>Invalid connection string: </strong><CODE>%s</CODE><br>\n'
                     '<!--\n%s\n%s\n-->\n'
                     % (s,t,v)), tb


=== Zope/lib/python/Shared/DC/ZRDB/DA.py 1.110.12.2 => 1.110.12.2.4.1 ===
--- Zope/lib/python/Shared/DC/ZRDB/DA.py:1.110.12.2	Mon Jul 21 12:36:47 2003
+++ Zope/lib/python/Shared/DC/ZRDB/DA.py	Mon Nov 17 17:10:01 2003
@@ -37,6 +37,7 @@
 from AccessControl.DTML import RestrictedDTML
 from webdav.Resource import Resource
 from webdav.Lockable import ResourceLockedError
+from zExceptions import BadRequest
 try: from IOBTree import Bucket
 except: Bucket=lambda:{}
 
@@ -411,7 +412,7 @@
                 c))
 
         try: DB__=dbc()
-        except: raise 'Database Error', (
+        except: raise BadRequest, (
             '%s is not connected to a database' % self.id)
 
         if hasattr(self, 'aq_parent'):


=== Zope/lib/python/Shared/DC/ZRDB/Search.py 1.20 => 1.20.90.1 ===
--- Zope/lib/python/Shared/DC/ZRDB/Search.py:1.20	Wed Aug 14 17:50:59 2002
+++ Zope/lib/python/Shared/DC/ZRDB/Search.py	Mon Nov 17 17:10:01 2003
@@ -50,7 +50,7 @@
                 arguments[key]=arg
                 keys.append(key)
         if q._searchable_result_columns() is None:
-            raise 'Unusable Searchable Error',(
+            raise ValueError,(
                 """The input searchable object, <em>%s</em>,
                 has not been tested.  Until it has been tested,
                 it\'s output schema is unknown, and a report


=== Zope/lib/python/Shared/DC/ZRDB/dbi_db.py 1.10 => 1.10.90.1 ===
--- Zope/lib/python/Shared/DC/ZRDB/dbi_db.py:1.10	Wed Aug 14 17:50:59 2002
+++ Zope/lib/python/Shared/DC/ZRDB/dbi_db.py	Mon Nov 17 17:10:01 2003
@@ -34,6 +34,9 @@
     ('Calls',  'STRING', 12, 12, 0, 0, 1),
     ]
 
+class QueryError(Exception):
+    pass
+
 class DB:
 
     _p_oid=_p_changed=_registered=None
@@ -42,7 +45,7 @@
 
     def Database_Connection(self, string):
         # Create a dbi-compatible database connection
-        raise 'ImplementedBySubclass', (
+        raise NotImplemetedError, (
             'attempt to create a database connection for an abstract dbi')
 
     Database_Error='Should be overriden by subclass'
@@ -79,12 +82,12 @@
             c=self.cursor
             self.register()
             queries=filter(None, map(strip,split(query_string, '\0')))
-            if not queries: raise 'Query Error', 'empty query'
+            if not queries: raise QueryError, 'empty query'
             if len(queries) > 1:
                 result=[]
                 for qs in queries:
                     r=c.execute(qs)
-                    if r is None: raise 'Query Error', (
+                    if r is None: raise QueryError, (
                         'select in multiple sql-statement query'
                         )
                     result.append((qs, str(`r`), calls))


=== Zope/lib/python/Shared/DC/ZRDB/sqlgroup.py 1.9 => 1.9.90.1 ===
--- Zope/lib/python/Shared/DC/ZRDB/sqlgroup.py:1.9	Wed Aug 14 17:50:59 2002
+++ Zope/lib/python/Shared/DC/ZRDB/sqlgroup.py	Mon Nov 17 17:10:01 2003
@@ -110,7 +110,7 @@
             return r
 
         if self.required:
-            raise 'Input Error', 'Not enough input was provided!<p>'
+            raise ValueError, 'Not enough input was provided!<p>'
 
         return ''
 


=== Zope/lib/python/Shared/DC/ZRDB/sqltest.py 1.18 => 1.18.90.1 ===
--- Zope/lib/python/Shared/DC/ZRDB/sqltest.py:1.18	Wed Aug 14 17:50:59 2002
+++ Zope/lib/python/Shared/DC/ZRDB/sqltest.py	Mon Nov 17 17:10:01 2003
@@ -129,11 +129,11 @@
         except KeyError:
             if args.has_key('optional') and args['optional']:
                 return ''
-            raise 'Missing Input', 'Missing input variable, <em>%s</em>' % name
+            raise ValueError, 'Missing input variable, <em>%s</em>' % name
 
         if type(v) in (ListType, TupleType):
             if len(v) > 1 and not self.multiple:
-                raise 'Multiple Values', (
+                raise ValueError, (
                     'multiple values are not allowed for <em>%s</em>'
                     % name)
         else: v=[v]
@@ -175,7 +175,7 @@
 
         if not vs:
             if self.optional: return ''
-            raise 'Missing Input', (
+            raise ValueError, (
                 'No input was provided for <em>%s</em>' % name)
 
         if len(vs) > 1:


=== Zope/lib/python/Shared/DC/ZRDB/sqlvar.py 1.14 => 1.14.32.1 ===
--- Zope/lib/python/Shared/DC/ZRDB/sqlvar.py:1.14	Wed Mar 19 15:21:23 2003
+++ Zope/lib/python/Shared/DC/ZRDB/sqlvar.py	Mon Nov 17 17:10:01 2003
@@ -96,7 +96,7 @@
                 return 'null'
             if type(expr) is not type(''):
                 raise
-            raise 'Missing Input', 'Missing input variable, <em>%s</em>' % name
+            raise ValueError, 'Missing input variable, <em>%s</em>' % name
 
         if t=='int':
             try:




More information about the Zope-Checkins mailing list