On Tue, 2009-09-22 at 10:15 +0100, Daniel P. Berrange wrote: > > One thing I am debating with myself is if the API should implicitly do an > > 'rm /augeas//error' for every call. IOW, error nodes would only stick > > around up until the next call to a aug_* function. The current behavior > > (they stick around until the user removes them) seems to make the API > > harder to use than it has to be. > > I think each API call should reset the error code, otherwise the scenario > you describe avove where aug_load returns success but also sets an error > wouldn't be easily handled. If the caller app sees success but finds an > error set, it can't be sure if that error was from from aug_load or a > previous call unless the app itself is careful to always reset the error > before each call. At which point you might as well always reset it > internally to augeas.
Sorry, I wasn't clear in the above: the internal error code is reset on every API call, i.e. aug_error() will only return something != AUG_NOERROR if the last API call failed. What I was talking about above is that some error details are reported inside the tree (e.g., details of why a load/save failed for each file where there was a problem) I agree though that I should just clean that out for each API call, too. David _______________________________________________ augeas-devel mailing list [email protected] https://www.redhat.com/mailman/listinfo/augeas-devel
