qvm-block & qvm-pool add better Exception handling
This commit is contained in:
parent
b712d0f6f3
commit
c0f1a6b4e8
@ -228,8 +228,13 @@ def get_parser():
|
||||
|
||||
def main(args=None):
|
||||
'''Main routine of :program:`qvm-block`.'''
|
||||
args = get_parser().parse_args(args)
|
||||
args.func(args)
|
||||
parser = get_parser()
|
||||
try:
|
||||
args = parser.parse_args(args)
|
||||
args.func(args)
|
||||
except qubes.exc.QubesException as e:
|
||||
parser.print_error(e.message)
|
||||
return 1
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
@ -187,7 +187,12 @@ def main(args=None):
|
||||
command line.
|
||||
'''
|
||||
parser = get_parser()
|
||||
args = parser.parse_args(args)
|
||||
try:
|
||||
args = parser.parse_args(args)
|
||||
except qubes.exc.QubesException as e:
|
||||
parser.print_error(e.message)
|
||||
return 1
|
||||
|
||||
if args.command is None or args.command == 'list':
|
||||
list_pools(args.app)
|
||||
elif args.command == 'add':
|
||||
|
Loading…
Reference in New Issue
Block a user