mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
qapi: Improve error position for bogus argument descriptions
When documented arguments don't exist, the error message points to the beginning of the definition comment. Point to the first bogus argument description instead. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-ID: <20240216145841.2099240-6-armbru@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
e51e80ccf6
commit
15333abed9
8 changed files with 10 additions and 8 deletions
|
@ -472,6 +472,8 @@ class QAPIDoc:
|
|||
# pylint: disable=too-few-public-methods
|
||||
def __init__(self, parser: QAPISchemaParser,
|
||||
name: Optional[str] = None):
|
||||
# section source info, i.e. where it begins
|
||||
self.info = parser.info
|
||||
# parser, for error messages about indentation
|
||||
self._parser = parser
|
||||
# optional section name (argument/member or section name)
|
||||
|
@ -770,7 +772,7 @@ class QAPIDoc:
|
|||
if not section.member]
|
||||
if bogus:
|
||||
raise QAPISemError(
|
||||
self.info,
|
||||
args[bogus[0]].info,
|
||||
"documented %s%s '%s' %s not exist" % (
|
||||
what,
|
||||
"s" if len(bogus) > 1 else "",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue