qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: [PATCH 6/9] QError: Add qdev not found error


From: Paolo Bonzini
Subject: [Qemu-devel] Re: [PATCH 6/9] QError: Add qdev not found error
Date: Mon, 19 Oct 2009 23:16:27 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20091014 Fedora/3.0-2.8.b4.fc11 Lightning/1.0pre Thunderbird/3.0b4

On 10/19/2009 06:50 PM, Hollis Blanchard wrote:
On Sun, 2009-10-18 at 14:17 +0200, Paolo Bonzini wrote:
On 10/18/2009 06:25 AM, Jamie Lokier wrote:
The manual for GNU gettext explains quite well why gettext takes a
message string as argument, instead of a "message code".  Imho, a
similar case can be made for error messages at call sites.

That's true.  However here we have the case of having errors consumed by
programs as well as users, so we want something that can be easily made
into language bindings.

In other words, this situation is much more similar to errno/strerror,
than to a compiler error message (which will often be used by other
programs, but where the actual error text will be read by a person; this
can and should use gettext).

So to extend your analogy, I think we're reaching the conclusion that
both errno *and* string should be returned to the client, right?

I'd say so, yes. And any parameters too, all as JSON. I think errno is just one kind of data that can be in an exception, and you want different exceptions for not opening a sound device or not opening an image file (even if both may fail with EACCES or ENOENT).

Paolo




reply via email to

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