extras-buildsys/client client.py,1.34,1.35

Daniel Williams (dcbw) fedora-extras-commits at redhat.com
Sun Feb 26 16:51:41 UTC 2006


Author: dcbw

Update of /cvs/fedora/extras-buildsys/client
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv28869/client

Modified Files:
	client.py 
Log Message:
2006-02-26  Dan Williams  <dcbw at redhat.com>

    * client/client.py
        - Handle more errors, and print them more nicely




Index: client.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/client/client.py,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- client.py	25 Nov 2005 04:45:01 -0000	1.34
+++ client.py	26 Feb 2006 16:51:34 -0000	1.35
@@ -425,19 +425,23 @@
         print e
         sys.exit(1)
 
+    exit_val = 1
     try:
         cmd = sys.argv[1]
         if cmd == 'help':
             Usage()
         else:
             cli.dispatch(cmd, sys.argv[2:])
+        exit_val = 0
     except CommandException, e:
         print e.message + "\n"
         Usage()
-        sys.exit(1)
-    except socket.error, e:
-        print "Error connecting to build server: '%s'" % e
-        sys.exit(1)
+    except socket.timeout, e:
+        print "Error: connection to the server timed out. '%s'" % e
+    except (socket.error, OpenSSL.SSL.SysCallError), e:
+        print "Error: an error ocurred connecting to the server. '%s'" % e
+    except xmlrpclib.Fault, e:
+        print "Error: an error ocurred communicating with the server. '%s'" % e
 
-    sys.exit(0)
+    sys.exit(exit_val)
 




More information about the fedora-extras-commits mailing list