Catch ValueError and OverflowError, to diagnose bad arguments.

Signed-off-by: Hiroyuki Yamamoto <yamamoto.hiroyu@jp.fujitsu.com>
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
This commit is contained in:
emellor@leeni.uk.xensource.com committed 2006-06-15 11:52:23 +01:00
1 parent aedc7640e6
commit a8bdc8130e
1 file changed
+3
+3
View File
@@ -1193,6 +1193,9 @@ def main(argv=sys.argv):
else:
print >>sys.stderr, "Error: %s" % ex.faultString
sys.exit(1)
except (ValueError, OverflowError):
err("Invalid argument.")
usage(argv[1])
except:
print "Unexpected error:", sys.exc_info()[0]
print
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.