[Zodb-checkins] CVS: ZODB3/ZEO - ClientStorage.py:1.84 Exceptions.py:1.6

Jeremy Hylton jeremy@zope.com
Wed, 15 Jan 2003 13:19:48 -0500


Update of /cvs-repository/ZODB3/ZEO
In directory cvs.zope.org:/tmp/cvs-serv13636/ZEO

Modified Files:
	ClientStorage.py Exceptions.py 
Log Message:
Rationalize disconnected exceptions so there is one root exception.

ZEO.Exceptions.ClientDisconnected will always be raised when a client
is disconnected.  There's also a subclass of this exception in
ZEO.zrpc.error so that it's possible to distinguish whether the error
occurred in the RPC layer or at the storage layer.


=== ZODB3/ZEO/ClientStorage.py 1.83 => 1.84 ===
--- ZODB3/ZEO/ClientStorage.py:1.83	Tue Jan 14 14:08:33 2003
+++ ZODB3/ZEO/ClientStorage.py	Wed Jan 15 13:19:15 2003
@@ -16,15 +16,8 @@
 Public contents of this module:
 
 ClientStorage -- the main class, implementing the Storage API
-ClientStorageError -- exception raised by ClientStorage
-UnrecognizedResult -- exception raised by ClientStorage
-ClientDisconnected -- exception raised by ClientStorage
 """
 
-# XXX TO DO
-# set self._storage = stub later, in endVerify
-# if wait is given, wait until verify is complete
-
 import cPickle
 import os
 import socket
@@ -35,7 +28,8 @@
 
 from ZEO import ClientCache, ServerStub
 from ZEO.TransactionBuffer import TransactionBuffer
-from ZEO.Exceptions import Disconnected
+from ZEO.Exceptions \
+     import ClientStorageError, UnrecognizedResult, ClientDisconnected
 from ZEO.zrpc.client import ConnectionManager
 
 from ZODB import POSException
@@ -50,15 +44,6 @@
 except ImportError:
     ResolvedSerial = 'rs'
 
-class ClientStorageError(POSException.StorageError):
-    """An error occured in the ZEO Client Storage."""
-
-class UnrecognizedResult(ClientStorageError):
-    """A server call returned an unrecognized result."""
-
-class ClientDisconnected(ClientStorageError, Disconnected):
-    """The database storage is disconnected from the storage."""
-
 def tid2time(tid):
     return str(TimeStamp(tid))
 
@@ -303,7 +288,7 @@
                 self._ready.wait(30)
                 if self._ready.isSet():
                     break
-                log2(INFO, "Waiting to connect to server")
+                log2(INFO, "Wait for cache verification to finish")
         else:
             # If there is no mainloop running, this code needs
             # to call poll() to cause asyncore to handle events.
@@ -317,7 +302,7 @@
                     cn.pending(30)
                 if self._ready.isSet():
                     break
-                log2(INFO, "Waiting to connect to server")
+                log2(INFO, "Wait for cache verification to finish")
 
     def close(self):
         """Storage API: finalize the storage, releasing external resources."""


=== ZODB3/ZEO/Exceptions.py 1.5 => 1.6 ===
--- ZODB3/ZEO/Exceptions.py:1.5	Thu Aug 29 12:31:17 2002
+++ ZODB3/ZEO/Exceptions.py	Wed Jan 15 13:19:15 2003
@@ -13,6 +13,14 @@
 ##############################################################################
 """Exceptions for ZEO."""
 
-class Disconnected(Exception):
-    """Exception raised when a ZEO client is disconnected from the
-    ZEO server."""
+from ZODB.POSException import StorageError
+
+class ClientStorageError(StorageError):
+    """An error occured in the ZEO Client Storage."""
+
+class UnrecognizedResult(ClientStorageError):
+    """A server call returned an unrecognized result."""
+
+class ClientDisconnected(ClientStorageError):
+    """The database storage is disconnected from the storage."""
+