mirror of
https://github.com/mii443/qemu.git
synced 2025-12-07 21:18:22 +00: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:
committed by
Eric Blake
parent
71a7510baf
commit
181feaf355
@@ -12,7 +12,7 @@
|
||||
|
||||
from __future__ import print_function
|
||||
import sys
|
||||
from qapi.common import QAPISchema, QAPISchemaVisitor
|
||||
from qapi.common import QAPIError, QAPISchema, QAPISchemaVisitor
|
||||
|
||||
|
||||
class QAPISchemaTestVisitor(QAPISchemaVisitor):
|
||||
@@ -52,7 +52,13 @@ class QAPISchemaTestVisitor(QAPISchemaVisitor):
|
||||
for v in variants.variants:
|
||||
print(' case %s: %s' % (v.name, v.type.name))
|
||||
|
||||
schema = QAPISchema(sys.argv[1])
|
||||
|
||||
try:
|
||||
schema = QAPISchema(sys.argv[1])
|
||||
except QAPIError as err:
|
||||
print(err, file=sys.stderr)
|
||||
exit(1)
|
||||
|
||||
schema.visit(QAPISchemaTestVisitor())
|
||||
|
||||
for doc in schema.docs:
|
||||
|
||||
Reference in New Issue
Block a user