You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vcl.apache.org by jf...@apache.org on 2010/02/22 15:19:42 UTC

svn commit: r912578 - /incubator/vcl/sandbox/useful_scripts/managegroups.py

Author: jfthomps
Date: Mon Feb 22 14:19:42 2010
New Revision: 912578

URL: http://svn.apache.org/viewvc?rev=912578&view=rev
Log:
added error handling for errors returned by the site that get interpreted as an XMLRPC fault

Modified:
    incubator/vcl/sandbox/useful_scripts/managegroups.py

Modified: incubator/vcl/sandbox/useful_scripts/managegroups.py
URL: http://svn.apache.org/viewvc/incubator/vcl/sandbox/useful_scripts/managegroups.py?rev=912578&r1=912577&r2=912578&view=diff
==============================================================================
--- incubator/vcl/sandbox/useful_scripts/managegroups.py (original)
+++ incubator/vcl/sandbox/useful_scripts/managegroups.py Mon Feb 22 14:19:42 2010
@@ -71,7 +71,22 @@
 		except AttributeError:
 			sock = None
 
-		return self._parse_response(h.getfile(), sock)
+		try:
+			resp = self._parse_response(h.getfile(), sock)
+		except xmlrpclib.Fault, err:
+			if(err.faultCode == 3):
+				print "ERROR: Received '%s' error. The credentials you supplied to log in to the VCL site were not accepted." % (err.faultString)
+			elif(err.faultCode == 4):
+				print "ERROR: %s" % (err.faultString)
+			elif(err.faultCode == 5):
+				print "ERROR: Received '%s' error. The VCL site could not establish a connection with your authentication server." % (err.faultString)
+			elif(err.faultCode == 6):
+				print "ERROR: Received '%s' error. The VCL site could not determine a method to use to authenticate the supplied user." % (err.faultString)
+			else:
+				print "ERROR: Received '%s' error from VCL site." % (err.faultString)
+			sys.exit(3)
+
+		return resp
 
 class VCLServerProxy(xmlrpclib.ServerProxy):
 	__userid = ''