Skip to content

Commit

Permalink
qapi: Slightly clearer error message for invalid "Returns" section
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Markus Armbruster committed Mar 4, 2024
1 parent ba7f63f commit 51e97c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions scripts/qapi/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,8 +716,9 @@ def connect_feature(self, feature: 'QAPISchemaFeature') -> None:

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:

Expand Down
2 changes: 1 addition & 1 deletion tests/qapi-schema/doc-invalid-return.err
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 51e97c1

Please sign in to comment.