qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v5 06/46] qapi: Improve 'include' error message


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v5 06/46] qapi: Improve 'include' error message
Date: Thu, 24 Sep 2015 10:04:48 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0

On 09/24/2015 08:39 AM, Markus Armbruster wrote:
> Eric Blake <address@hidden> writes:
> 
>> Use of '"...%s" % include' to print non-strings can lead to
>> ugly messages, such as this (if the .json change is applied
>> without the qapi.py change):
>>  Expected a file name (string), got: OrderedDict()
>>
>> Better is to just omit the actual non-string value in the
>> message.
>>
>> Signed-off-by: Eric Blake <address@hidden>
>> ---

>> +                    raise QAPIExprError(expr_info,
>> +                                        "Expected a string for 'include'")

>> +++ b/tests/qapi-schema/include-non-file.json
>> @@ -1 +1 @@
>> -{ 'include': [ 'foo', 'bar' ] }
>> +{ 'include': {} }
> 
> What about "Value of 'include' must be a string'?

Sure, the bikeshed looks better in green :)

Actually, I like your wording better, so I'll go with it (not too hard,
since I already am hoisting this patch to occur before the pep8 cleanups
to reduce churn on the message, due to your feedback on 2/46).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]