qapi: Slightly clearer error message for invalid "Returns" section
Change "'Returns:' is only valid for commands" to "'Returns' section
is only valid for commands".
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20240227113921.236097-3-armbru@redhat.com>
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index bfc47cf..e4c2259 100644
--- a/scripts/qapi/parser.py
+++ b/scripts/qapi/parser.py
@@ -716,8 +716,9 @@
def check_expr(self, expr: QAPIExpression) -> None:
if self.returns and 'command' not in expr:
- raise QAPISemError(self.returns.info,
- "'Returns:' is only valid for commands")
+ raise QAPISemError(
+ self.returns.info,
+ "'Returns' section is only valid for commands")
def check(self) -> None:
diff --git a/tests/qapi-schema/doc-invalid-return.err b/tests/qapi-schema/doc-invalid-return.err
index 3d9e71c..aafd57b 100644
--- a/tests/qapi-schema/doc-invalid-return.err
+++ b/tests/qapi-schema/doc-invalid-return.err
@@ -1 +1 @@
-doc-invalid-return.json:6: 'Returns:' is only valid for commands
+doc-invalid-return.json:6: 'Returns' section is only valid for commands