On 12/16/20 4:22 AM, Markus Armbruster wrote:
2. On error with "no source info", don't crash.
I have my doubts on this one.
Such an error means the QAPI code generator screwed up, at least in
theory. Crashing is only proper. It gets the screwup fixed.
QAPISemError and friends will also halt the generator and don't produce
output and will fail tests. They aren't less visible or more ignorable
somehow.
In practice, errors due to interactions between built-in stuff and
user-defined stuff could conceivably escape testing. I can't
remember such a case offhand.
Will the "no source info" error be more useful than a crash?
Possibly. Will it get the screwup fixed? Maybe not.
I don't understand this; if it's an error -- there's no QAPI, there's no
QEMU. It's definitely getting fixed.
If QAPISourceInfo is primarily used for printing error information, we
are already in a situation where the generator is hosed and has wandered
itself into a problem that can't be ignored.
There's no additional value in having python crash twice per every crash
because we have bad types in our error reporting functions.
--js