extras-buildsys/client client.py,1.31.2.3,1.31.2.4

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


Author: dcbw

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

Modified Files:
      Tag: STABLE_0_4
	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.31.2.3
retrieving revision 1.31.2.4
diff -u -r1.31.2.3 -r1.31.2.4
--- client.py	24 Nov 2005 22:38:57 -0000	1.31.2.3
+++ client.py	26 Feb 2006 16:52:17 -0000	1.31.2.4
@@ -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 scm-commits mailing list