[Yum-devel] [Patch] yum-metadata-parser: clear errors

James Bowes jbowes at redhat.com
Fri Aug 18 16:09:16 UTC 2006


Tambet Ingo wrote:
> On Fri, 2006-08-18 at 09:59 -0400, James Bowes wrote:
>> The following patch frees the memory used by any existing GErrors before 
>> setting a new one while parsing the xml metadata.
> 
> Hmm, I thought libxml2 would stop the parsing after parser errors. In
> case it doesn't do that by default, we need to force it somehow, instead
> of loosing the original errors.

Agreed, thought it might be good to try and clear out the GErrors first 
as well, just in case.

However, I poked around a bit with libxml2, and I could find no way to 
make it abort parsing after hitting an error.

The best solutions I have would be to either:
Set the GError and log a message at the same time.
Only set the first GError, so when the parser is finished, it will be 
displayed in the traceback.

I prefer the second one.

-James

> 
> Tambet
> 
> _______________________________________________
> Yum-devel mailing list
> Yum-devel at linux.duke.edu
> https://lists.dulug.duke.edu/mailman/listinfo/yum-devel




More information about the Yum-devel mailing list