Re: new ruby error handling

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

 



On Sun, Apr 13, 2008 at 08:13:51PM -0700, Vadim Zaliva wrote:
> I guess my main complaint is that in some cases message is not a coherent 
> English phrase, something I can show to users. So I would prefer to have 
> "Error during call to XXX" instead of just "XXX".

[Not a direct answer about the Ruby bindings, but ...]

virterror is a confusing and over-engineered bit of code.  It would
have been better just to raise string errors (as in Perl).

But anyway if you can call __virErrorMsg then you should be able to
translate the message into something (a) readable and (b) translated.

eg. Code in libvirt which does this:

   qemudReportError (dom->conn, dom, NULL, VIR_ERR_NO_SUPPORT,
                     "%s", __FUNCTION__);

should be translated like this in __virErrorMsg (note '_' which means
it gets translated):

   _("this function is not supported by the hypervisor: %s")

Rich.

-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]