[Zodb-checkins] CVS: ZODB3/ZEO/zrpc - error.py:1.5 smac.py:1.37

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


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

Modified Files:
	error.py smac.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/zrpc/error.py 1.4 => 1.5 ===
--- ZODB3/ZEO/zrpc/error.py:1.4	Wed Sep 25 18:28:10 2002
+++ ZODB3/ZEO/zrpc/error.py	Wed Jan 15 13:19:18 2003
@@ -12,10 +12,16 @@
 #
 ##############################################################################
 from ZODB import POSException
-from ZEO.Exceptions import Disconnected
+from ZEO.Exceptions import ClientDisconnected
 
 class ZRPCError(POSException.StorageError):
     pass
 
-class DisconnectedError(ZRPCError, Disconnected):
-    """The database storage is disconnected from the storage server."""
+class DisconnectedError(ZRPCError, ClientDisconnected):
+    """The database storage is disconnected from the storage server.
+
+    The error occurred because a problem in the low-level RPC connection,
+    or because the connection was closed.
+    """
+
+    # This subclass is raised when zrpc catches the error.


=== ZODB3/ZEO/zrpc/smac.py 1.36 => 1.37 ===
--- ZODB3/ZEO/zrpc/smac.py:1.36	Mon Nov 18 18:17:40 2002
+++ ZODB3/ZEO/zrpc/smac.py	Wed Jan 15 13:19:18 2003
@@ -15,11 +15,11 @@
 
 import asyncore, struct
 import threading
-from ZEO.Exceptions import Disconnected
-import zLOG
 from types import StringType
 
 from ZEO.zrpc.log import log, short_repr
+from ZEO.zrpc.error import DisconnectedError
+import zLOG
 
 import socket, errno
 
@@ -209,10 +209,8 @@
                     level=zLOG.TRACE)
 
         if self.__closed:
-            raise Disconnected, (
-                "This action is temporarily unavailable."
-                "<p>"
-                )
+            raise DisconnectedError(
+                "This action is temporarily unavailable.<p>")
         self.__output_lock.acquire()
         try:
             # do two separate appends to avoid copying the message string