scripts: apibuild: Improve error when API is missing from symbol file

Improve:

 KeyError: 'virAdmConnectSetDaemonTimeout'

to

 Exception: Missing symbol file entry for 'virAdmConnectSetDaemonTimeout'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Peter Krempa 2022-06-13 14:44:08 +02:00
parent c53e0c9535
commit 12a76fb81e

View File

@ -2405,6 +2405,8 @@ class docBuilder:
# NB: this is consumed by a regex in 'getAPIFilenames' in hvsupport.pl # NB: this is consumed by a regex in 'getAPIFilenames' in hvsupport.pl
if id.type == "function": if id.type == "function":
if name not in self.versions:
raise Exception("Missing symbol file entry for '%s'" % name)
ver = self.versions[name] ver = self.versions[name]
if ver is None: if ver is None:
raise Exception("Missing version for '%s'" % name) raise Exception("Missing version for '%s'" % name)