From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NI1GU-0004J4-GU for qemu-devel@nongnu.org; Tue, 08 Dec 2009 09:42:10 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NI1GN-0004HP-22 for qemu-devel@nongnu.org; Tue, 08 Dec 2009 09:42:07 -0500 Received: from [199.232.76.173] (port=57075 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NI1GL-0004Gz-CH for qemu-devel@nongnu.org; Tue, 08 Dec 2009 09:42:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:24883) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NI1GK-0007gU-Tt for qemu-devel@nongnu.org; Tue, 08 Dec 2009 09:42:01 -0500 Date: Tue, 8 Dec 2009 12:41:50 -0200 From: Luiz Capitulino Subject: Re: [Qemu-devel] Re: [FOR 0.12 PATCH 18/18] QMP: add human-readable description to error response Message-ID: <20091208124150.109dd20f@doriath> In-Reply-To: <4B1E5213.1070502@codemonkey.ws> References: <1260218236-22143-1-git-send-email-armbru@redhat.com> <1260218236-22143-19-git-send-email-armbru@redhat.com> <20091208101148.119bed20@doriath> <4B1E5213.1070502@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: aliguori@us.ibm.com, Markus Armbruster , qemu-devel@nongnu.org On Tue, 08 Dec 2009 07:18:11 -0600 Anthony Liguori wrote: > Luiz Capitulino wrote: > > On Mon, 7 Dec 2009 21:37:16 +0100 > > Markus Armbruster wrote: > > > > > >> -{ "error": { "class": json-string, "data": json-value }, "id": json-value } > >> +{ "error": { "class": json-string, "data": json-value, "desc": json-string }, > >> + "id": json-value } > >> > >> Where, > >> > >> - The "class" member contains the error class name (eg. "ServiceUnavailable") > >> - The "data" member contains specific error data and is defined in a > >> per-command basis, it will be an empty json-object if the error has no data > >> +- The "desc" member is a human-readable error message. Clients should > >> + not attempt to parse this message. > >> - The "id" member contains the transaction identification associated with > >> the command execution (if issued by the Client) > >> > > > > As we've talked on irc, I don't agree with this change. > > > > Basically, adding 'desc' to the standard error message introduces all > > the problems we've discussed about free-form English strings. > > > > It's not free form English. The 'desc' string is always autogenerated > based on the error object. > > It's completely redundant information because you can already generate > that string, but it simplifies client creation because a lazy client > does not have to include the conversion table if they only care about > English error output. I wonder if we could have a simpler design for the internal API if we knew in advance that 'desc' would be part of the standard error message, eg. error code based. But, as Markus said it's not the 'worst' as I've put it, let's move forward then.