[xml] Possible error reporting addition to the library



Title: Possible error reporting addition to the library

I've attached the error.c and xmlerror.h files to show a change I would be interested in coding for the library. I've bordered the areas of code that I thought to add to make them easier to find.  Very interested in thoughts.

Sample usage:
        xmlUseErrorCodes  ();

        xmlDocPtr docPtr = xmlParseFile (filePath);

        if (docPtr != NULL)
        {
                // Do something
        }
        else
        {
                switch (xmlGetErrorCode ())
                {
                        // Process errors via application
                }
        }

Notes:
1. Initially, the code would simply look for defined error strings to set the error code value;
2. Eventually, another mechanism could be implemented and used by the other modules;
3. Multiple errors could be reported by OR'ing them together (if appropriate).

Thanks for your time,
Eugene Thompson

<<error.c>> <<xmlerror.h>>

Attachment: error.c
Description: Binary data

Attachment: xmlerror.h
Description: Binary data



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