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

Re: [libvirt] [PATCH 1/2] xen: add error handling to UUID parsing



On 10/06/2011 01:36 PM, Guido Günther wrote:
Hi Eric,
On Thu, Oct 06, 2011 at 10:50:46AM -0600, Eric Blake wrote:

These three errors should probably all be changed away from
VIR_ERR_INTERNAL_ERROR into something more useful, but I'm not sure
whether that would be VIR_ERR_CONF_SYNTAX,
VIR_ERR_CONFIG_UNSUPPORTED, or something else.
I was uncertain about the error codes too, that's why I kept
VIR_ERR_INTERNAL_ERROR as used by other functions in this file. I'd
opt for VIR_ERR_CONF_SYNTAX.

We really need to agree on a policy on which code to use for which type of errors, write it down, then go through the code and correct everything that's wrong. INTERNAL_ERROR is used *a lot* in XML parsing where it obviously shouldn't be. Much of it is probably code written before the CONFIG_UNSUPPORTED, XML_ERROR, and CONF_SYNTAX codes were added, but I'd wager just as much is due to people writing new code who look to the existing code for guidelines (I know I've done this a lot, and continue to be confused about which code to use in a lot of cases - heck, this is the first I've noticed CONF_SYNTAX, and I'm not sure when it would be appropriate to use that vs. XML_ERROR).


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