From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NBWKg-00019U-Gf for qemu-devel@nongnu.org; Fri, 20 Nov 2009 11:27:38 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NBWKb-00013M-U6 for qemu-devel@nongnu.org; Fri, 20 Nov 2009 11:27:38 -0500 Received: from [199.232.76.173] (port=40790 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBWKb-000139-KU for qemu-devel@nongnu.org; Fri, 20 Nov 2009 11:27:33 -0500 Received: from mail-fx0-f222.google.com ([209.85.220.222]:45270) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NBWKb-0003Z8-AF for qemu-devel@nongnu.org; Fri, 20 Nov 2009 11:27:33 -0500 Received: by fxm22 with SMTP id 22so4228737fxm.2 for ; Fri, 20 Nov 2009 08:27:32 -0800 (PST) Message-ID: <4B06C36F.9080802@codemonkey.ws> Date: Fri, 20 Nov 2009 10:27:27 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 00/10]: QError v4 References: <1258487037-24950-1-git-send-email-lcapitulino@redhat.com> <4B04383A.9050101@linux.vnet.ibm.com> <20091119023651.GA15128@shareable.org> <4B06BC3E.5060806@codemonkey.ws> <20091120142043.7ea716b9@doriath> In-Reply-To: <20091120142043.7ea716b9@doriath> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: kraxel@redhat.com, qemu-devel@nongnu.org, Markus Armbruster Luiz Capitulino wrote: > On Fri, 20 Nov 2009 09:56:46 -0600 > Anthony Liguori wrote: > > >> Jamie Lokier wrote: >> >>> Anthony Liguori wrote: >>> >>> >>>> Markus Armbruster wrote: >>>> >>>> >>>>> 3. It falls short of the requirement that clients can easily present a >>>>> human-readable error description to their human users, regardless of >>>>> whether they know the error or not. >>>>> >>>>> >>>>> >>>> That's just incorrect. We provide an example conversion table that's >>>> akin to strerror() or a __repr__ for an exception in Python. >>>> >>>> >>> Markus refers to errors that the client does not know - i.e. when the >>> client is older than qemu, or is not in the same development branch if >>> it's a branched qemu. Which means the client won't have a fully up to >>> date conversion table. >>> > > What's the proper fix for this? I can only think of having QError on > library, which is what we're going to do, anyway. > There are two use cases to consider. The first is logging of errors. Logging the json representation of a QError should be just as good for postmortem debugging as a formatted description. That's really the point, there is no additional information in the formatted description. The second use case is presenting an error message to a user. My contention is that a good UI is not going to present an unknown error to a user either in JSON representation or in a non-localized string. Both are equally gibberish to non-English speakers. I think your suggestion of just offering the error class is the best I've heard so far. That at least makes the message google-able. >>> Do you mean qemu provides it's current conversion table to the client >>> over the wire protocol? >>> >>> >> (qemu) format_error "{'class': 'DeviceNotFound', 'data' : {'addr': >> '00:11:22'} }" >> Device 0:11:22 is not present >> >> Is what I'm thinking. I don't think it's needed but it solves the >> "problem". >> > > Couldn't the client print the error class for errors it doesn't > know about? Like: > > "Unknown error: 'CloudProtocol'" > > I know this is bad, but seems a lot better than printing something > with the wrong locale (ie, 'desc'). > Yes, I agree completely. I was offering format_error only as a concession. I honestly believe that the structured data is just as good to a developer as the message and that the message if not localized is gibberish to the user. Regards, Anthony Liguori