additionally logging filename and XML content on parse failures
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 8 Nov 2007 14:31:59 +0000 (14:31 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 8 Nov 2007 14:31:59 +0000 (14:31 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@8038 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/apachemods/mod_xmlent.c

index 757dd79..07379c1 100644 (file)
@@ -339,10 +339,15 @@ static int xmlEntHandler( ap_filter_t *f, apr_bucket_brigade *brigade ) {
                        /* push data into the XML push parser */
                        if ( XML_Parse(ctx->parser, data, len, 0) == XML_STATUS_ERROR ) {
 
+                char tmp[len+1];
+                memcpy(tmp, data, len);
+                tmp[len] = '\0';
+
                                /* log and die on XML errors */
-                               ap_log_rerror( APLOG_MARK, APLOG_ERR, 0, f->r, "XMLENT XML Parse Error: %s at line %d\n",
+                               ap_log_rerror( APLOG_MARK, APLOG_ERR, 0, f->r, 
+                    "XMLENT XML Parse Error: %s at line %d: parsing %s: data %s",
                                        XML_ErrorString(XML_GetErrorCode(ctx->parser)), 
-                                       (int) XML_GetCurrentLineNumber(ctx->parser));
+                                       (int) XML_GetCurrentLineNumber(ctx->parser), f->r->filename, tmp);
 
                                XML_ParserFree(parser);
                                parser = NULL;