You are viewing a plain text version of this content. The canonical link for it is here.
Posted to tashi-commits@incubator.apache.org by st...@apache.org on 2012/06/28 21:24:52 UTC
svn commit: r1355162 -
/incubator/tashi/trunk/src/tashi/client/tashi-client.py
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__":