[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[minion-cvs] Generate exception messages correctly



Update of /home/minion/cvsroot/src/minion/lib/mixminion
In directory moria.mit.edu:/tmp/cvs-serv2792/lib/mixminion

Modified Files:
	ClientDirectory.py 
Log Message:
Generate exception messages correctly

Index: ClientDirectory.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/ClientDirectory.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- ClientDirectory.py	28 Nov 2003 04:14:03 -0000	1.20
+++ ClientDirectory.py	8 Dec 2003 02:25:48 -0000	1.21
@@ -761,7 +761,7 @@
         for e in p:
             fixed = e.getFixedServer(self, startAt, endAt)
             if prevFixed and fixed and not prevFixed.canRelayTo(fixed):
-                raise UIError("Server %s can't relay to %s",
+                raise UIError("Server %s can't relay to %s" %
                               prevFixed.getNickname(), fixed.getNickname())
             prevFixed = fixed
 
@@ -770,15 +770,15 @@
         if lh is not None:
             lh_s = self.getServerInfo(lh, startAt, endAt)
             if lh_s is None:
-                raise UIError("No known server descriptor named %s",lh)
+                raise UIError("No known server descriptor named %s" % lh)
             if fs and not fs.canRelayTo(lh_s):
-                raise UIError("Server %s can't relay to %s",
-                              fs.getNickname(), lh)
+                raise UIError("Server %s can't relay to %s" %(
+                              fs.getNickname(), lh))
             fs = lh_s
         if fs is not None:
             exitAddress.checkSupportedByServer(fs)
         elif exitAddress.isServerRelative():
-            raise UIError("%s exit type expects a fixed exit server.",
+            raise UIError("%s exit type expects a fixed exit server." %
                           exitAddress.getPrettyExitType())
 
         # Check for unrecommended servers
@@ -1052,7 +1052,7 @@
             sware = desc['Server'].get("Software","")
             if (sware.startswith("Mixminion 0.0.4") or
                 sware.startswith("Mixminion 0.0.5alpha1")):
-                raise UIError("Server %s is running old software that doesn't support exit headers.", nickname)
+                raise UIError("Server %s is running old software that doesn't support exit headers."% nickname)
 
         exitKB = ceilDiv(self.exitSize, 1024)
 
@@ -1240,7 +1240,7 @@
         self.desc = desc
     def validate(self, directory, start, end):
         if not self.desc.isValidFrom(start, end):
-            raise UIError("Server %r is not valid during given time range",
+            raise UIError("Server %r is not valid during given time range" %
                            self.desc.getNickname())
     def getFixedServer(self, directory, start, end):
         return self.desc