incubator-tashi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strou...@apache.org
Subject svn commit: r1355162 - /incubator/tashi/trunk/src/tashi/client/tashi-client.py
Date Thu, 28 Jun 2012 21:24:52 GMT
Author: stroucki
Date: Thu Jun 28 21:24:51 2012
New Revision: 1355162

URL: http://svn.apache.org/viewvc?rev=1355162&view=rev
Log:
tashi-client: convert "unknown user" to a TashiException
tashi-client: print out nicer messages on exceptions - comment again for better debugging

Modified:
    incubator/tashi/trunk/src/tashi/client/tashi-client.py

Modified: incubator/tashi/trunk/src/tashi/client/tashi-client.py
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/tashi/client/tashi-client.py?rev=1355162&r1=1355161&r2=1355162&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/client/tashi-client.py (original)
+++ incubator/tashi/trunk/src/tashi/client/tashi-client.py Thu Jun 28 21:24:51 2012
@@ -50,7 +50,7 @@ def getUser():
 	for user in users:
 		if (users[user].name == userStr):
 			return users[user].id
-	raise ValueError("Unknown user %s" % (userStr))
+	raise TashiException({'msg':"Unknown user %s" % (userStr)})
 
 def checkHid(host):
 	userId = getUser()
@@ -665,15 +665,12 @@ def main():
 			except Exception, e:
 				print e
 	except TashiException, e:
-		print "TashiException:"
+		print "A Tashi exception occurred""
 		print e.msg
 		exitCode = e.errno
-# 	except Exception, e:
-# 		print e
-		# XXXstroucki: exception may be unrelated to usage of function
-		# so don't print usage on exception as if there were a problem
-		# with the arguments
-		#usage(function)
+ 	except Exception, e:
+		print "A general exception occurred"
+ 		print e
 	sys.exit(exitCode)
 
 if __name__ == "__main__":



Mime
View raw message