diff --git a/qubes/tools/qvm_block.py b/qubes/tools/qvm_block.py index 855370c2..76bfe1e9 100644 --- a/qubes/tools/qvm_block.py +++ b/qubes/tools/qvm_block.py @@ -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__': diff --git a/qubes/tools/qvm_pool.py b/qubes/tools/qvm_pool.py index 0444d56d..ca289f6d 100644 --- a/qubes/tools/qvm_pool.py +++ b/qubes/tools/qvm_pool.py @@ -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':