WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

Re: [Xen-API] Xen-API C Bindings, version 0.4.1

On Wed, Aug 09, 2006 at 05:26:34PM +0100, Ewan Mellor wrote:

> >   Sorry, that's horrible, because you loose locality of the error.
> > Errors should be detected as soon as possible to be able to report 
> > them as accurately as possible.
> 
> If you want to detect them as soon as possible, just have if (session->ok)
> after every call.  It's no harder than if (return_value == NULL/-1/0/false).

I don't think the issue is whether it's possible to do so, but whether it's
natural. It's rather unnatural IMO to have this out-of-band error notification
in a C API. It's hard enough to get people to check return values when they
exist, never mind when they're implicit. (Yes, people should always strive to
get this right, but the perfect never happens, so it's really all about
minimising the error as much as possible...)

regards
john

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api