[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [libvirt] PATCH: Improve python exception messages
- From: Daniel Veillard <veillard redhat com>
- To: "Daniel P. Berrange" <berrange redhat com>
- Cc: libvir-list redhat com
- Subject: Re: [libvirt] PATCH: Improve python exception messages
- Date: Tue, 19 Aug 2008 15:38:07 +0200
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 veillard com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]