direct-io.hg

changeset 10354:3e221d43cf19

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>
author emellor@leeni.uk.xensource.com
date Thu Jun 15 11:52:23 2006 +0100 (2006-06-15)
parents bd1a0b2bb2d4
children 7fba181c8531
files tools/python/xen/xm/main.py
line diff
     1.1 --- a/tools/python/xen/xm/main.py	Thu Jun 15 11:35:23 2006 +0100
     1.2 +++ b/tools/python/xen/xm/main.py	Thu Jun 15 11:52:23 2006 +0100
     1.3 @@ -1193,6 +1193,9 @@ def main(argv=sys.argv):
     1.4              else:
     1.5                  print  >>sys.stderr, "Error: %s" % ex.faultString
     1.6              sys.exit(1)
     1.7 +        except (ValueError, OverflowError):
     1.8 +            err("Invalid argument.")
     1.9 +            usage(argv[1])
    1.10          except:
    1.11              print "Unexpected error:", sys.exc_info()[0]
    1.12              print