From 181feaf3555136dd7883e2434c4498ca1939bf1a Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 11 Feb 2018 10:35:51 +0100 Subject: qapi: Lift error reporting from QAPISchema.__init__() to callers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Markus Armbruster Reviewed-by: Marc-André Lureau Message-Id: <20180211093607.27351-14-armbru@redhat.com> Reviewed-by: Eric Blake Reviewed-by: Michael Roth Signed-off-by: Eric Blake --- tests/qapi-schema/test-qapi.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/qapi-schema/test-qapi.py b/tests/qapi-schema/test-qapi.py index bb1b6dd..4da14b4 100644 --- a/tests/qapi-schema/test-qapi.py +++ b/tests/qapi-schema/test-qapi.py @@ -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: -- cgit v1.1