mirror of
https://github.com/mii443/qemu.git
synced 2025-08-23 15:48:20 +00: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:
@ -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 "",
|
||||
|
Reference in New Issue
Block a user