mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
qapi: Lift error reporting from QAPISchema.__init__() to callers
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20180211093607.27351-14-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
71a7510baf
commit
181feaf355
3 changed files with 23 additions and 18 deletions
|
@ -8,7 +8,7 @@ from __future__ import print_function
|
|||
import argparse
|
||||
import re
|
||||
import sys
|
||||
from qapi.common import QAPISchema
|
||||
from qapi.common import QAPIError, QAPISchema
|
||||
from qapi.types import gen_types
|
||||
from qapi.visit import gen_visit
|
||||
from qapi.commands import gen_commands
|
||||
|
@ -39,7 +39,11 @@ def main(argv):
|
|||
file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
schema = QAPISchema(args.schema)
|
||||
try:
|
||||
schema = QAPISchema(args.schema)
|
||||
except QAPIError as err:
|
||||
print(err, file=sys.stderr)
|
||||
exit(1)
|
||||
|
||||
gen_types(schema, args.output_dir, args.prefix, args.builtins)
|
||||
gen_visit(schema, args.output_dir, args.prefix, args.builtins)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue