Re: [libvirt] PATCH: Improve python exception messages

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

 



On Tue, Aug 19, 2008 at 10:31:34AM +0100, Daniel P. Berrange wrote:
> Most of the libvirt python API bindings use code snippet like this when
> raising an exception:
> 
>     if ret is None:raise libvirtError('virConnectOpen() failed')
> 
> 
> THis sets the message associated with the exception to
> 
>     "virConnectOpen() failed"
> 
> This contains essentially zero useful information - you can see that it
> was virConnectOpen which failed from the stack trace.
> 
> Now the libvirt error object has a real message, such as
> 
>    "authentication failed"
> 
> Or
> 
>    "unable to connect to '/var/run/libvirt/libvirt-sock': Connection refused"
> 
> This patch makes sure we extract this real error message and use it to 
> set the message associated with the exception object. This is one step
> in getting better error reporting for virt-install/virt-manager, which
> is particularly needed for remote connections

  Good idea, +1,

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel@xxxxxxxxxxxx  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

--
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]